Theorem: Lean4Axiomatic.Integer.Impl.Difference.sgn_positive (Lean4Axiomatic/Integer/Impl/Difference/Sign.lean)

State before:
ℕ : Type
inst✝ : Natural ℕ
a : Difference ℕ
⊢ Positive a ↔ a.sgn ≃ 1
Tactic:
revert a
State after:
ℕ : Type
inst✝ : Natural ℕ
⊢ ∀ {a : Difference ℕ}, Positive a ↔ a.sgn ≃ 1

State before:
ℕ : Type
inst✝ : Natural ℕ
⊢ ∀ {a : Difference ℕ}, Positive a ↔ a.sgn ≃ 1
Tactic:
intro (n——m)
State after:
ℕ : Type
inst✝ : Natural ℕ
n m : ℕ
⊢ Positive (n——m) ↔ (n——m).sgn ≃ 1

State before:
ℕ : Type
inst✝ : Natural ℕ
n m : ℕ
⊢ Positive (n——m) ↔ (n——m).sgn ≃ 1
Tactic:
apply Iff.intro
State after:
case mp
ℕ : Type
inst✝ : Natural ℕ
n m : ℕ
⊢ Positive (n——m) → (n——m).sgn ≃ 1

case mpr
ℕ : Type
inst✝ : Natural ℕ
n m : ℕ
⊢ (n——m).sgn ≃ 1 → Positive (n——m)

State before:
ℕ : Type
inst✝ : Natural ℕ
n m : ℕ
⊢ Positive (n——m) → (n——m).sgn ≃ 1
Tactic:
case mp =>
  intro (_ : Positive (n——m))
  show sgn (n——m) ≃ 1
  have : n > m := pos_diff_gt.mp ‹Positive (n——m)›
  have : compare n m = Ordering.gt := Natural.compare_gt.mpr this
  have : ord_sgn (compare n m) ≃ ord_sgn Ordering.gt :=
    ord_sgn_subst (ℤ := Difference ℕ) this
  have : ord_sgn (compare n m) ≃ (1:Difference ℕ) := this
  have : sgn (n——m) ≃ 1 := this
  exact this
State after:
no goals

State before:
ℕ : Type
inst✝ : Natural ℕ
n m : ℕ
⊢ (n——m).sgn ≃ 1 → Positive (n——m)
Tactic:
case mpr =>
  intro (_ : sgn (n——m) ≃ 1)
  show Positive (n——m)
  have : ord_sgn (compare n m) ≃ (1:Difference ℕ) := ‹sgn (n——m) ≃ 1›
  have : ord_sgn (compare n m) ≃ ord_sgn Ordering.gt := this
  have : compare n m = Ordering.gt := ord_sgn_inject this
  have : n > m := Natural.compare_gt.mp this
  have : Positive (n——m) := pos_diff_gt.mpr this
  exact this
State after:
no goals

State before:
ℕ : Type
inst✝ : Natural ℕ
n m : ℕ
⊢ Positive (n——m) → (n——m).sgn ≃ 1
Tactic:
intro (_ : Positive (n——m))
State after:
ℕ : Type
inst✝ : Natural ℕ
n m : ℕ
x✝ : Positive (n——m)
⊢ (n——m).sgn ≃ 1

State before:
ℕ : Type
inst✝ : Natural ℕ
n m : ℕ
x✝ : Positive (n——m)
⊢ (n——m).sgn ≃ 1
Tactic:
have : n > m := pos_diff_gt.mp ‹Positive (n——m)›
State after:
ℕ : Type
inst✝ : Natural ℕ
n m : ℕ
x✝ : Positive (n——m)
this : n > m
⊢ (n——m).sgn ≃ 1

State before:
ℕ : Type
inst✝ : Natural ℕ
n m : ℕ
x✝ : Positive (n——m)
this : n > m
⊢ (n——m).sgn ≃ 1
Tactic:
have : compare n m = Ordering.gt := Natural.compare_gt.mpr this
State after:
ℕ : Type
inst✝ : Natural ℕ
n m : ℕ
x✝ : Positive (n——m)
this✝ : n > m
this : compare n m = Ordering.gt
⊢ (n——m).sgn ≃ 1

State before:
ℕ : Type
inst✝ : Natural ℕ
n m : ℕ
x✝ : Positive (n——m)
this✝ : n > m
this : compare n m = Ordering.gt
⊢ (n——m).sgn ≃ 1
Tactic:
have : ord_sgn (compare n m) ≃ ord_sgn Ordering.gt :=
  ord_sgn_subst (ℤ := Difference ℕ) this
State after:
ℕ : Type
inst✝ : Natural ℕ
n m : ℕ
x✝ : Positive (n——m)
this✝¹ : n > m
this✝ : compare n m = Ordering.gt
this : ord_sgn (compare n m) ≃ ord_sgn Ordering.gt
⊢ (n——m).sgn ≃ 1

State before:
ℕ : Type
inst✝ : Natural ℕ
n m : ℕ
x✝ : Positive (n——m)
this✝¹ : n > m
this✝ : compare n m = Ordering.gt
this : ord_sgn (compare n m) ≃ ord_sgn Ordering.gt
⊢ (n——m).sgn ≃ 1
Tactic:
have : ord_sgn (compare n m) ≃ (1:Difference ℕ) := this
State after:
ℕ : Type
inst✝ : Natural ℕ
n m : ℕ
x✝ : Positive (n——m)
this✝² : n > m
this✝¹ : compare n m = Ordering.gt
this✝ : ord_sgn (compare n m) ≃ ord_sgn Ordering.gt
this : ord_sgn (compare n m) ≃ 1
⊢ (n——m).sgn ≃ 1

State before:
ℕ : Type
inst✝ : Natural ℕ
n m : ℕ
x✝ : Positive (n——m)
this✝² : n > m
this✝¹ : compare n m = Ordering.gt
this✝ : ord_sgn (compare n m) ≃ ord_sgn Ordering.gt
this : ord_sgn (compare n m) ≃ 1
⊢ (n——m).sgn ≃ 1
Tactic:
have : sgn (n——m) ≃ 1 := this
State after:
ℕ : Type
inst✝ : Natural ℕ
n m : ℕ
x✝ : Positive (n——m)
this✝³ : n > m
this✝² : compare n m = Ordering.gt
this✝¹ : ord_sgn (compare n m) ≃ ord_sgn Ordering.gt
this✝ : ord_sgn (compare n m) ≃ 1
this : (n——m).sgn ≃ 1
⊢ (n——m).sgn ≃ 1

State before:
ℕ : Type
inst✝ : Natural ℕ
n m : ℕ
x✝ : Positive (n——m)
this✝³ : n > m
this✝² : compare n m = Ordering.gt
this✝¹ : ord_sgn (compare n m) ≃ ord_sgn Ordering.gt
this✝ : ord_sgn (compare n m) ≃ 1
this : (n——m).sgn ≃ 1
⊢ (n——m).sgn ≃ 1
Tactic:
exact this
State after:
no goals

State before:
ℕ : Type
inst✝ : Natural ℕ
n m : ℕ
⊢ (n——m).sgn ≃ 1 → Positive (n——m)
Tactic:
intro (_ : sgn (n——m) ≃ 1)
State after:
ℕ : Type
inst✝ : Natural ℕ
n m : ℕ
x✝ : (n——m).sgn ≃ 1
⊢ Positive (n——m)

State before:
ℕ : Type
inst✝ : Natural ℕ
n m : ℕ
x✝ : (n——m).sgn ≃ 1
⊢ Positive (n——m)
Tactic:
have : ord_sgn (compare n m) ≃ (1:Difference ℕ) := ‹sgn (n——m) ≃ 1›
State after:
ℕ : Type
inst✝ : Natural ℕ
n m : ℕ
x✝ : (n——m).sgn ≃ 1
this : ord_sgn (compare n m) ≃ 1
⊢ Positive (n——m)

State before:
ℕ : Type
inst✝ : Natural ℕ
n m : ℕ
x✝ : (n——m).sgn ≃ 1
this : ord_sgn (compare n m) ≃ 1
⊢ Positive (n——m)
Tactic:
have : ord_sgn (compare n m) ≃ ord_sgn Ordering.gt := this
State after:
ℕ : Type
inst✝ : Natural ℕ
n m : ℕ
x✝ : (n——m).sgn ≃ 1
this✝ : ord_sgn (compare n m) ≃ 1
this : ord_sgn (compare n m) ≃ ord_sgn Ordering.gt
⊢ Positive (n——m)

State before:
ℕ : Type
inst✝ : Natural ℕ
n m : ℕ
x✝ : (n——m).sgn ≃ 1
this✝ : ord_sgn (compare n m) ≃ 1
this : ord_sgn (compare n m) ≃ ord_sgn Ordering.gt
⊢ Positive (n——m)
Tactic:
have : compare n m = Ordering.gt := ord_sgn_inject this
State after:
ℕ : Type
inst✝ : Natural ℕ
n m : ℕ
x✝ : (n——m).sgn ≃ 1
this✝¹ : ord_sgn (compare n m) ≃ 1
this✝ : ord_sgn (compare n m) ≃ ord_sgn Ordering.gt
this : compare n m = Ordering.gt
⊢ Positive (n——m)

State before:
ℕ : Type
inst✝ : Natural ℕ
n m : ℕ
x✝ : (n——m).sgn ≃ 1
this✝¹ : ord_sgn (compare n m) ≃ 1
this✝ : ord_sgn (compare n m) ≃ ord_sgn Ordering.gt
this : compare n m = Ordering.gt
⊢ Positive (n——m)
Tactic:
have : n > m := Natural.compare_gt.mp this
State after:
ℕ : Type
inst✝ : Natural ℕ
n m : ℕ
x✝ : (n——m).sgn ≃ 1
this✝² : ord_sgn (compare n m) ≃ 1
this✝¹ : ord_sgn (compare n m) ≃ ord_sgn Ordering.gt
this✝ : compare n m = Ordering.gt
this : n > m
⊢ Positive (n——m)

State before:
ℕ : Type
inst✝ : Natural ℕ
n m : ℕ
x✝ : (n——m).sgn ≃ 1
this✝² : ord_sgn (compare n m) ≃ 1
this✝¹ : ord_sgn (compare n m) ≃ ord_sgn Ordering.gt
this✝ : compare n m = Ordering.gt
this : n > m
⊢ Positive (n——m)
Tactic:
have : Positive (n——m) := pos_diff_gt.mpr this
State after:
ℕ : Type
inst✝ : Natural ℕ
n m : ℕ
x✝ : (n——m).sgn ≃ 1
this✝³ : ord_sgn (compare n m) ≃ 1
this✝² : ord_sgn (compare n m) ≃ ord_sgn Ordering.gt
this✝¹ : compare n m = Ordering.gt
this✝ : n > m
this : Positive (n——m)
⊢ Positive (n——m)

State before:
ℕ : Type
inst✝ : Natural ℕ
n m : ℕ
x✝ : (n——m).sgn ≃ 1
this✝³ : ord_sgn (compare n m) ≃ 1
this✝² : ord_sgn (compare n m) ≃ ord_sgn Ordering.gt
this✝¹ : compare n m = Ordering.gt
this✝ : n > m
this : Positive (n——m)
⊢ Positive (n——m)
Tactic:
exact this
State after:
no goals