Theorem: NonemptyInterval.mul_eq_one_iff
File: Mathlib/Algebra/Order/Interval/Basic.lean

tactic: refine ⟨fun h => ?_, ?_⟩
state_before: ι : Type u_1
α : Type u_2
inst✝ : OrderedCommGroup α
s t : NonemptyInterval α
⊢ s * t = 1 ↔ ∃ a b, s = pure a ∧ t = pure b ∧ a * b = 1
state_after: case refine_1
ι : Type u_1
α : Type u_2
inst✝ : OrderedCommGroup α
s t : NonemptyInterval α
h : s * t = 1
⊢ ∃ a b, s = pure a ∧ t = pure b ∧ a * b = 1

case refine_2
ι : Type u_1
α : Type u_2
inst✝ : OrderedCommGroup α
s t : NonemptyInterval α
⊢ (∃ a b, s = pure a ∧ t = pure b ∧ a * b = 1) → s * t = 1

tactic: rw [NonemptyInterval.ext_iff, Prod.ext_iff] at h
state_before: case refine_1
ι : Type u_1
α : Type u_2
inst✝ : OrderedCommGroup α
s t : NonemptyInterval α
h : s * t = 1
⊢ ∃ a b, s = pure a ∧ t = pure b ∧ a * b = 1
state_after: case refine_1
ι : Type u_1
α : Type u_2
inst✝ : OrderedCommGroup α
s t : NonemptyInterval α
h : (s * t).toProd.1 = (toProd 1).1 ∧ (s * t).toProd.2 = (toProd 1).2
⊢ ∃ a b, s = pure a ∧ t = pure b ∧ a * b = 1

tactic: have := (mul_le_mul_iff_of_ge s.fst_le_snd t.fst_le_snd).1 (h.2.trans h.1.symm).le
state_before: case refine_1
ι : Type u_1
α : Type u_2
inst✝ : OrderedCommGroup α
s t : NonemptyInterval α
h : (s * t).toProd.1 = (toProd 1).1 ∧ (s * t).toProd.2 = (toProd 1).2
⊢ ∃ a b, s = pure a ∧ t = pure b ∧ a * b = 1
state_after: case refine_1
ι : Type u_1
α : Type u_2
inst✝ : OrderedCommGroup α
s t : NonemptyInterval α
h : (s * t).toProd.1 = (toProd 1).1 ∧ (s * t).toProd.2 = (toProd 1).2
this : s.toProd.1 = s.toProd.2 ∧ t.toProd.1 = t.toProd.2
⊢ ∃ a b, s = pure a ∧ t = pure b ∧ a * b = 1

tactic: refine ⟨s.fst, t.fst, ?_, ?_, h.1⟩ <;> apply NonemptyInterval.ext <;> dsimp [pure]
state_before: case refine_1
ι : Type u_1
α : Type u_2
inst✝ : OrderedCommGroup α
s t : NonemptyInterval α
h : (s * t).toProd.1 = (toProd 1).1 ∧ (s * t).toProd.2 = (toProd 1).2
this : s.toProd.1 = s.toProd.2 ∧ t.toProd.1 = t.toProd.2
⊢ ∃ a b, s = pure a ∧ t = pure b ∧ a * b = 1
state_after: case refine_1.refine_1.toProd
ι : Type u_1
α : Type u_2
inst✝ : OrderedCommGroup α
s t : NonemptyInterval α
h : (s * t).toProd.1 = (toProd 1).1 ∧ (s * t).toProd.2 = (toProd 1).2
this : s.toProd.1 = s.toProd.2 ∧ t.toProd.1 = t.toProd.2
⊢ s.toProd = (s.toProd.1, s.toProd.1)

case refine_1.refine_2.toProd
ι : Type u_1
α : Type u_2
inst✝ : OrderedCommGroup α
s t : NonemptyInterval α
h : (s * t).toProd.1 = (toProd 1).1 ∧ (s * t).toProd.2 = (toProd 1).2
this : s.toProd.1 = s.toProd.2 ∧ t.toProd.1 = t.toProd.2
⊢ t.toProd = (t.toProd.1, t.toProd.1)

tactic: nth_rw 2 [this.1]
state_before: case refine_1.refine_1.toProd
ι : Type u_1
α : Type u_2
inst✝ : OrderedCommGroup α
s t : NonemptyInterval α
h : (s * t).toProd.1 = (toProd 1).1 ∧ (s * t).toProd.2 = (toProd 1).2
this : s.toProd.1 = s.toProd.2 ∧ t.toProd.1 = t.toProd.2
⊢ s.toProd = (s.toProd.1, s.toProd.1)
state_after: no goals

tactic: nth_rw 2 [this.2]
state_before: case refine_1.refine_2.toProd
ι : Type u_1
α : Type u_2
inst✝ : OrderedCommGroup α
s t : NonemptyInterval α
h : (s * t).toProd.1 = (toProd 1).1 ∧ (s * t).toProd.2 = (toProd 1).2
this : s.toProd.1 = s.toProd.2 ∧ t.toProd.1 = t.toProd.2
⊢ t.toProd = (t.toProd.1, t.toProd.1)
state_after: no goals

tactic: rintro ⟨b, c, rfl, rfl, h⟩
state_before: case refine_2
ι : Type u_1
α : Type u_2
inst✝ : OrderedCommGroup α
s t : NonemptyInterval α
⊢ (∃ a b, s = pure a ∧ t = pure b ∧ a * b = 1) → s * t = 1
state_after: case refine_2.intro.intro.intro.intro
ι : Type u_1
α : Type u_2
inst✝ : OrderedCommGroup α
b c : α
h : b * c = 1
⊢ pure b * pure c = 1

tactic: rw [pure_mul_pure, h, pure_one]
state_before: case refine_2.intro.intro.intro.intro
ι : Type u_1
α : Type u_2
inst✝ : OrderedCommGroup α
b c : α
h : b * c = 1
⊢ pure b * pure c = 1
state_after: no goals