Theorem: ModularGroup.exists_eq_T_zpow_of_c_eq_zero
File: Mathlib/NumberTheory/Modular.lean

tactic: have had := g.det_coe
state_before: g : SL(2, ℤ)
z : ℍ
hc : ↑g 1 0 = 0
⊢ ∃ n, ∀ (z : ℍ), g • z = T ^ n • z
state_after: g : SL(2, ℤ)
z : ℍ
hc : ↑g 1 0 = 0
had : (↑g).det = 1
⊢ ∃ n, ∀ (z : ℍ), g • z = T ^ n • z

tactic: replace had : (↑ₘg) 0 0 * (↑ₘg) 1 1 = 1 := by rw [det_fin_two, hc] at had; linarith
state_before: g : SL(2, ℤ)
z : ℍ
hc : ↑g 1 0 = 0
had : (↑g).det = 1
⊢ ∃ n, ∀ (z : ℍ), g • z = T ^ n • z
state_after: g : SL(2, ℤ)
z : ℍ
hc : ↑g 1 0 = 0
had : ↑g 0 0 * ↑g 1 1 = 1
⊢ ∃ n, ∀ (z : ℍ), g • z = T ^ n • z

tactic: rcases Int.eq_one_or_neg_one_of_mul_eq_one' had with (⟨ha, hd⟩ | ⟨ha, hd⟩)
state_before: g : SL(2, ℤ)
z : ℍ
hc : ↑g 1 0 = 0
had : ↑g 0 0 * ↑g 1 1 = 1
⊢ ∃ n, ∀ (z : ℍ), g • z = T ^ n • z
state_after: case inl.intro
g : SL(2, ℤ)
z : ℍ
hc : ↑g 1 0 = 0
had : ↑g 0 0 * ↑g 1 1 = 1
ha : ↑g 0 0 = 1
hd : ↑g 1 1 = 1
⊢ ∃ n, ∀ (z : ℍ), g • z = T ^ n • z

case inr.intro
g : SL(2, ℤ)
z : ℍ
hc : ↑g 1 0 = 0
had : ↑g 0 0 * ↑g 1 1 = 1
ha : ↑g 0 0 = -1
hd : ↑g 1 1 = -1
⊢ ∃ n, ∀ (z : ℍ), g • z = T ^ n • z

tactic: rw [det_fin_two, hc] at had
state_before: g : SL(2, ℤ)
z : ℍ
hc : ↑g 1 0 = 0
had : (↑g).det = 1
⊢ ↑g 0 0 * ↑g 1 1 = 1
state_after: g : SL(2, ℤ)
z : ℍ
hc : ↑g 1 0 = 0
had : ↑g 0 0 * ↑g 1 1 - ↑g 0 1 * 0 = 1
⊢ ↑g 0 0 * ↑g 1 1 = 1

tactic: linarith
state_before: g : SL(2, ℤ)
z : ℍ
hc : ↑g 1 0 = 0
had : ↑g 0 0 * ↑g 1 1 - ↑g 0 1 * 0 = 1
⊢ ↑g 0 0 * ↑g 1 1 = 1
state_after: no goals

tactic: use (↑ₘg) 0 1
state_before: case inl.intro
g : SL(2, ℤ)
z : ℍ
hc : ↑g 1 0 = 0
had : ↑g 0 0 * ↑g 1 1 = 1
ha : ↑g 0 0 = 1
hd : ↑g 1 1 = 1
⊢ ∃ n, ∀ (z : ℍ), g • z = T ^ n • z
state_after: case h
g : SL(2, ℤ)
z : ℍ
hc : ↑g 1 0 = 0
had : ↑g 0 0 * ↑g 1 1 = 1
ha : ↑g 0 0 = 1
hd : ↑g 1 1 = 1
⊢ ∀ (z : ℍ), g • z = T ^ ↑g 0 1 • z

tactic: suffices g = T ^ (↑ₘg) 0 1 by intro z; conv_lhs => rw [this]
state_before: case h
g : SL(2, ℤ)
z : ℍ
hc : ↑g 1 0 = 0
had : ↑g 0 0 * ↑g 1 1 = 1
ha : ↑g 0 0 = 1
hd : ↑g 1 1 = 1
⊢ ∀ (z : ℍ), g • z = T ^ ↑g 0 1 • z
state_after: case h
g : SL(2, ℤ)
z : ℍ
hc : ↑g 1 0 = 0
had : ↑g 0 0 * ↑g 1 1 = 1
ha : ↑g 0 0 = 1
hd : ↑g 1 1 = 1
⊢ g = T ^ ↑g 0 1

tactic: ext i j
state_before: case h
g : SL(2, ℤ)
z : ℍ
hc : ↑g 1 0 = 0
had : ↑g 0 0 * ↑g 1 1 = 1
ha : ↑g 0 0 = 1
hd : ↑g 1 1 = 1
⊢ g = T ^ ↑g 0 1
state_after: case h.a
g : SL(2, ℤ)
z : ℍ
hc : ↑g 1 0 = 0
had : ↑g 0 0 * ↑g 1 1 = 1
ha : ↑g 0 0 = 1
hd : ↑g 1 1 = 1
i j : Fin 2
⊢ ↑g i j = ↑(T ^ ↑g 0 1) i j

tactic: fin_cases i <;> fin_cases j <;>
simp [ha, hc, hd, coe_T_zpow, show (1 : Fin (0 + 2)) = (1 : Fin 2) from rfl]
state_before: case h.a
g : SL(2, ℤ)
z : ℍ
hc : ↑g 1 0 = 0
had : ↑g 0 0 * ↑g 1 1 = 1
ha : ↑g 0 0 = 1
hd : ↑g 1 1 = 1
i j : Fin 2
⊢ ↑g i j = ↑(T ^ ↑g 0 1) i j
state_after: no goals

tactic: intro z
state_before: g : SL(2, ℤ)
z : ℍ
hc : ↑g 1 0 = 0
had : ↑g 0 0 * ↑g 1 1 = 1
ha : ↑g 0 0 = 1
hd : ↑g 1 1 = 1
this : g = T ^ ↑g 0 1
⊢ ∀ (z : ℍ), g • z = T ^ ↑g 0 1 • z
state_after: g : SL(2, ℤ)
z✝ : ℍ
hc : ↑g 1 0 = 0
had : ↑g 0 0 * ↑g 1 1 = 1
ha : ↑g 0 0 = 1
hd : ↑g 1 1 = 1
this : g = T ^ ↑g 0 1
z : ℍ
⊢ g • z = T ^ ↑g 0 1 • z

tactic: conv_lhs => rw [this]
state_before: g : SL(2, ℤ)
z✝ : ℍ
hc : ↑g 1 0 = 0
had : ↑g 0 0 * ↑g 1 1 = 1
ha : ↑g 0 0 = 1
hd : ↑g 1 1 = 1
this : g = T ^ ↑g 0 1
z : ℍ
⊢ g • z = T ^ ↑g 0 1 • z
state_after: no goals

tactic: use -((↑ₘg) 0 1)
state_before: case inr.intro
g : SL(2, ℤ)
z : ℍ
hc : ↑g 1 0 = 0
had : ↑g 0 0 * ↑g 1 1 = 1
ha : ↑g 0 0 = -1
hd : ↑g 1 1 = -1
⊢ ∃ n, ∀ (z : ℍ), g • z = T ^ n • z
state_after: case h
g : SL(2, ℤ)
z : ℍ
hc : ↑g 1 0 = 0
had : ↑g 0 0 * ↑g 1 1 = 1
ha : ↑g 0 0 = -1
hd : ↑g 1 1 = -1
⊢ ∀ (z : ℍ), g • z = T ^ (-↑g 0 1) • z

tactic: suffices g = -T ^ (-((↑ₘg) 0 1)) by intro z; conv_lhs => rw [this, SL_neg_smul]
state_before: case h
g : SL(2, ℤ)
z : ℍ
hc : ↑g 1 0 = 0
had : ↑g 0 0 * ↑g 1 1 = 1
ha : ↑g 0 0 = -1
hd : ↑g 1 1 = -1
⊢ ∀ (z : ℍ), g • z = T ^ (-↑g 0 1) • z
state_after: case h
g : SL(2, ℤ)
z : ℍ
hc : ↑g 1 0 = 0
had : ↑g 0 0 * ↑g 1 1 = 1
ha : ↑g 0 0 = -1
hd : ↑g 1 1 = -1
⊢ g = -T ^ (-↑g 0 1)

tactic: ext i j
state_before: case h
g : SL(2, ℤ)
z : ℍ
hc : ↑g 1 0 = 0
had : ↑g 0 0 * ↑g 1 1 = 1
ha : ↑g 0 0 = -1
hd : ↑g 1 1 = -1
⊢ g = -T ^ (-↑g 0 1)
state_after: case h.a
g : SL(2, ℤ)
z : ℍ
hc : ↑g 1 0 = 0
had : ↑g 0 0 * ↑g 1 1 = 1
ha : ↑g 0 0 = -1
hd : ↑g 1 1 = -1
i j : Fin 2
⊢ ↑g i j = ↑(-T ^ (-↑g 0 1)) i j

tactic: fin_cases i <;> fin_cases j <;>
simp [ha, hc, hd, coe_T_zpow, show (1 : Fin (0 + 2)) = (1 : Fin 2) from rfl]
state_before: case h.a
g : SL(2, ℤ)
z : ℍ
hc : ↑g 1 0 = 0
had : ↑g 0 0 * ↑g 1 1 = 1
ha : ↑g 0 0 = -1
hd : ↑g 1 1 = -1
i j : Fin 2
⊢ ↑g i j = ↑(-T ^ (-↑g 0 1)) i j
state_after: no goals

tactic: intro z
state_before: g : SL(2, ℤ)
z : ℍ
hc : ↑g 1 0 = 0
had : ↑g 0 0 * ↑g 1 1 = 1
ha : ↑g 0 0 = -1
hd : ↑g 1 1 = -1
this : g = -T ^ (-↑g 0 1)
⊢ ∀ (z : ℍ), g • z = T ^ (-↑g 0 1) • z
state_after: g : SL(2, ℤ)
z✝ : ℍ
hc : ↑g 1 0 = 0
had : ↑g 0 0 * ↑g 1 1 = 1
ha : ↑g 0 0 = -1
hd : ↑g 1 1 = -1
this : g = -T ^ (-↑g 0 1)
z : ℍ
⊢ g • z = T ^ (-↑g 0 1) • z

tactic: conv_lhs => rw [this, SL_neg_smul]
state_before: g : SL(2, ℤ)
z✝ : ℍ
hc : ↑g 1 0 = 0
had : ↑g 0 0 * ↑g 1 1 = 1
ha : ↑g 0 0 = -1
hd : ↑g 1 1 = -1
this : g = -T ^ (-↑g 0 1)
z : ℍ
⊢ g • z = T ^ (-↑g 0 1) • z
state_after: no goals