Theorem: Gamma1_mem
File: Mathlib/NumberTheory/ModularForms/CongruenceSubgroups.lean

tactic: constructor
state_before: N✝ N : ℕ
A : SL(2, ℤ)
⊢ A ∈ Gamma1 N ↔ ↑(↑A 0 0) = 1 ∧ ↑(↑A 1 1) = 1 ∧ ↑(↑A 1 0) = 0

tactic: intro ha
state_before: case mp
N✝ N : ℕ
A : SL(2, ℤ)
⊢ A ∈ Gamma1 N → ↑(↑A 0 0) = 1 ∧ ↑(↑A 1 1) = 1 ∧ ↑(↑A 1 0) = 0

tactic: simp_rw [Gamma1, Subgroup.mem_map] at ha
state_before: case mp
N✝ N : ℕ
A : SL(2, ℤ)
ha : A ∈ Gamma1 N
⊢ ↑(↑A 0 0) = 1 ∧ ↑(↑A 1 1) = 1 ∧ ↑(↑A 1 0) = 0

tactic: obtain ⟨⟨x, hx⟩, hxx⟩ := ha
state_before: case mp
N✝ N : ℕ
A : SL(2, ℤ)
ha : ∃ x, x ∈ ⊤ ∧ ↑(MonoidHom.comp (Subgroup.subtype (Gamma0 N)) (Subgroup.subtype (Gamma1' N))) x = A
⊢ ↑(↑A 0 0) = 1 ∧ ↑(↑A 1 1) = 1 ∧ ↑(↑A 1 0) = 0

tactic: rw [Gamma1_to_Gamma0_mem] at hx
state_before: case mp.intro.mk
N✝ N : ℕ
A : SL(2, ℤ)
x : { x // x ∈ Gamma0 N }
hx : x ∈ Gamma1' N
hxx :
  { val := x, property := hx } ∈ ⊤ ∧
    ↑(MonoidHom.comp (Subgroup.subtype (Gamma0 N)) (Subgroup.subtype (Gamma1' N))) { val := x, property := hx } = A
⊢ ↑(↑A 0 0) = 1 ∧ ↑(↑A 1 1) = 1 ∧ ↑(↑A 1 0) = 0

tactic: simp only [Subgroup.mem_top, true_and] at hxx
state_before: case mp.intro.mk
N✝ N : ℕ
A : SL(2, ℤ)
x : { x // x ∈ Gamma0 N }
hx✝ : x ∈ Gamma1' N
hx : ↑(↑↑x 0 0) = 1 ∧ ↑(↑↑x 1 1) = 1 ∧ ↑(↑↑x 1 0) = 0
hxx :
  { val := x, property := hx✝ } ∈ ⊤ ∧
    ↑(MonoidHom.comp (Subgroup.subtype (Gamma0 N)) (Subgroup.subtype (Gamma1' N))) { val := x, property := hx✝ } = A
⊢ ↑(↑A 0 0) = 1 ∧ ↑(↑A 1 1) = 1 ∧ ↑(↑A 1 0) = 0

tactic: rw [← hxx]
state_before: case mp.intro.mk
N✝ N : ℕ
A : SL(2, ℤ)
x : { x // x ∈ Gamma0 N }
hx✝ : x ∈ Gamma1' N
hx : ↑(↑↑x 0 0) = 1 ∧ ↑(↑↑x 1 1) = 1 ∧ ↑(↑↑x 1 0) = 0
hxx : ↑(MonoidHom.comp (Subgroup.subtype (Gamma0 N)) (Subgroup.subtype (Gamma1' N))) { val := x, property := hx✝ } = A
⊢ ↑(↑A 0 0) = 1 ∧ ↑(↑A 1 1) = 1 ∧ ↑(↑A 1 0) = 0

tactic: convert hx
state_before: case mp.intro.mk
N✝ N : ℕ
A : SL(2, ℤ)
x : { x // x ∈ Gamma0 N }
hx✝ : x ∈ Gamma1' N
hx : ↑(↑↑x 0 0) = 1 ∧ ↑(↑↑x 1 1) = 1 ∧ ↑(↑↑x 1 0) = 0
hxx : ↑(MonoidHom.comp (Subgroup.subtype (Gamma0 N)) (Subgroup.subtype (Gamma1' N))) { val := x, property := hx✝ } = A
⊢ ↑(↑(↑(MonoidHom.comp (Subgroup.subtype (Gamma0 N)) (Subgroup.subtype (Gamma1' N))) { val := x, property := hx✝ }) 0
          0) =
      1 ∧
    ↑(↑(↑(MonoidHom.comp (Subgroup.subtype (Gamma0 N)) (Subgroup.subtype (Gamma1' N))) { val := x, property := hx✝ }) 1
            1) =
        1 ∧
      ↑(↑(↑(MonoidHom.comp (Subgroup.subtype (Gamma0 N)) (Subgroup.subtype (Gamma1' N))) { val := x, property := hx✝ })
            1 0) =
        0

tactic: intro ha
state_before: case mpr
N✝ N : ℕ
A : SL(2, ℤ)
⊢ ↑(↑A 0 0) = 1 ∧ ↑(↑A 1 1) = 1 ∧ ↑(↑A 1 0) = 0 → A ∈ Gamma1 N

tactic: simp_rw [Gamma1, Subgroup.mem_map]
state_before: case mpr
N✝ N : ℕ
A : SL(2, ℤ)
ha : ↑(↑A 0 0) = 1 ∧ ↑(↑A 1 1) = 1 ∧ ↑(↑A 1 0) = 0
⊢ A ∈ Gamma1 N

tactic: have hA : A ∈ Gamma0 N := by simp [ha.right.right, Gamma0_mem]
state_before: case mpr
N✝ N : ℕ
A : SL(2, ℤ)
ha : ↑(↑A 0 0) = 1 ∧ ↑(↑A 1 1) = 1 ∧ ↑(↑A 1 0) = 0
⊢ ∃ x, x ∈ ⊤ ∧ ↑(MonoidHom.comp (Subgroup.subtype (Gamma0 N)) (Subgroup.subtype (Gamma1' N))) x = A

tactic: have HA : (⟨A, hA⟩ : Gamma0 N) ∈ Gamma1' N := by
  simp only [Gamma1_to_Gamma0_mem, Subgroup.coe_mk, coe_matrix_coe,
    Int.coe_castRingHom, map_apply]
  exact ha
state_before: case mpr
N✝ N : ℕ
A : SL(2, ℤ)
ha : ↑(↑A 0 0) = 1 ∧ ↑(↑A 1 1) = 1 ∧ ↑(↑A 1 0) = 0
hA : A ∈ Gamma0 N
⊢ ∃ x, x ∈ ⊤ ∧ ↑(MonoidHom.comp (Subgroup.subtype (Gamma0 N)) (Subgroup.subtype (Gamma1' N))) x = A

tactic: refine' ⟨(⟨(⟨A, hA⟩ : Gamma0 N), HA⟩ : (Gamma1' N : Subgroup (Gamma0 N))), _⟩
state_before: case mpr
N✝ N : ℕ
A : SL(2, ℤ)
ha : ↑(↑A 0 0) = 1 ∧ ↑(↑A 1 1) = 1 ∧ ↑(↑A 1 0) = 0
hA : A ∈ Gamma0 N
HA : { val := A, property := hA } ∈ Gamma1' N
⊢ ∃ x, x ∈ ⊤ ∧ ↑(MonoidHom.comp (Subgroup.subtype (Gamma0 N)) (Subgroup.subtype (Gamma1' N))) x = A

tactic: simp
state_before: case mpr
N✝ N : ℕ
A : SL(2, ℤ)
ha : ↑(↑A 0 0) = 1 ∧ ↑(↑A 1 1) = 1 ∧ ↑(↑A 1 0) = 0
hA : A ∈ Gamma0 N
HA : { val := A, property := hA } ∈ Gamma1' N
⊢ { val := { val := A, property := hA }, property := HA } ∈ ⊤ ∧
    ↑(MonoidHom.comp (Subgroup.subtype (Gamma0 N)) (Subgroup.subtype (Gamma1' N)))
        { val := { val := A, property := hA }, property := HA } =
      A

tactic: simp [ha.right.right, Gamma0_mem]
state_before: N✝ N : ℕ
A : SL(2, ℤ)
ha : ↑(↑A 0 0) = 1 ∧ ↑(↑A 1 1) = 1 ∧ ↑(↑A 1 0) = 0
⊢ A ∈ Gamma0 N

tactic: simp only [Gamma1_to_Gamma0_mem, Subgroup.coe_mk, coe_matrix_coe,
  Int.coe_castRingHom, map_apply]
state_before: N✝ N : ℕ
A : SL(2, ℤ)
ha : ↑(↑A 0 0) = 1 ∧ ↑(↑A 1 1) = 1 ∧ ↑(↑A 1 0) = 0
hA : A ∈ Gamma0 N
⊢ { val := A, property := hA } ∈ Gamma1' N

tactic: exact ha
state_before: N✝ N : ℕ
A : SL(2, ℤ)
ha : ↑(↑A 0 0) = 1 ∧ ↑(↑A 1 1) = 1 ∧ ↑(↑A 1 0) = 0
hA : A ∈ Gamma0 N
⊢ ↑(↑A 0 0) = 1 ∧ ↑(↑A 1 1) = 1 ∧ ↑(↑A 1 0) = 0