Theorem: Subgroup.index_comap_of_surjective
File: Mathlib/GroupTheory/Index.lean

tactic: letI := QuotientGroup.leftRel H
state_before: G : Type u_1
inst✝¹ : Group G
H K L : Subgroup G
G' : Type u_2
inst✝ : Group G'
f : G' →* G
hf : Function.Surjective ⇑f
⊢ (comap f H).index = H.index
state_after: G : Type u_1
inst✝¹ : Group G
H K L : Subgroup G
G' : Type u_2
inst✝ : Group G'
f : G' →* G
hf : Function.Surjective ⇑f
this : Setoid G := QuotientGroup.leftRel H
⊢ (comap f H).index = H.index

tactic: letI := QuotientGroup.leftRel (H.comap f)
state_before: G : Type u_1
inst✝¹ : Group G
H K L : Subgroup G
G' : Type u_2
inst✝ : Group G'
f : G' →* G
hf : Function.Surjective ⇑f
this : Setoid G := QuotientGroup.leftRel H
⊢ (comap f H).index = H.index
state_after: G : Type u_1
inst✝¹ : Group G
H K L : Subgroup G
G' : Type u_2
inst✝ : Group G'
f : G' →* G
hf : Function.Surjective ⇑f
this✝ : Setoid G := QuotientGroup.leftRel H
this : Setoid G' := QuotientGroup.leftRel (comap f H)
⊢ (comap f H).index = H.index

tactic: refine Cardinal.toNat_congr (Equiv.ofBijective (Quotient.map' f fun x y => (key x y).mp) ⟨?_, ?_⟩)
state_before: G : Type u_1
inst✝¹ : Group G
H K L : Subgroup G
G' : Type u_2
inst✝ : Group G'
f : G' →* G
hf : Function.Surjective ⇑f
this✝ : Setoid G := QuotientGroup.leftRel H
this : Setoid G' := QuotientGroup.leftRel (comap f H)
key : ∀ (x y : G'), Setoid.r x y ↔ Setoid.r (f x) (f y)
⊢ (comap f H).index = H.index
state_after: case refine_1
G : Type u_1
inst✝¹ : Group G
H K L : Subgroup G
G' : Type u_2
inst✝ : Group G'
f : G' →* G
hf : Function.Surjective ⇑f
this✝ : Setoid G := QuotientGroup.leftRel H
this : Setoid G' := QuotientGroup.leftRel (comap f H)
key : ∀ (x y : G'), Setoid.r x y ↔ Setoid.r (f x) (f y)
⊢ Function.Injective (Quotient.map' ⇑f ⋯)

case refine_2
G : Type u_1
inst✝¹ : Group G
H K L : Subgroup G
G' : Type u_2
inst✝ : Group G'
f : G' →* G
hf : Function.Surjective ⇑f
this✝ : Setoid G := QuotientGroup.leftRel H
this : Setoid G' := QuotientGroup.leftRel (comap f H)
key : ∀ (x y : G'), Setoid.r x y ↔ Setoid.r (f x) (f y)
⊢ Function.Surjective (Quotient.map' ⇑f ⋯)

tactic: simp only [QuotientGroup.leftRel_apply]
state_before: G : Type u_1
inst✝¹ : Group G
H K L : Subgroup G
G' : Type u_2
inst✝ : Group G'
f : G' →* G
hf : Function.Surjective ⇑f
this✝ : Setoid G := QuotientGroup.leftRel H
this : Setoid G' := QuotientGroup.leftRel (comap f H)
⊢ ∀ (x y : G'), Setoid.r x y ↔ Setoid.r (f x) (f y)
state_after: G : Type u_1
inst✝¹ : Group G
H K L : Subgroup G
G' : Type u_2
inst✝ : Group G'
f : G' →* G
hf : Function.Surjective ⇑f
this✝ : Setoid G := QuotientGroup.leftRel H
this : Setoid G' := QuotientGroup.leftRel (comap f H)
⊢ ∀ (x y : G'), x⁻¹ * y ∈ comap f H ↔ (f x)⁻¹ * f y ∈ H

tactic: rw [f.map_mul, f.map_inv]
state_before: G : Type u_1
inst✝¹ : Group G
H K L : Subgroup G
G' : Type u_2
inst✝ : Group G'
f : G' →* G
hf : Function.Surjective ⇑f
this✝ : Setoid G := QuotientGroup.leftRel H
this : Setoid G' := QuotientGroup.leftRel (comap f H)
x y : G'
⊢ f (x⁻¹ * y) = (f x)⁻¹ * f y
state_after: no goals

tactic: simp_rw [← Quotient.eq''] at key
state_before: case refine_1
G : Type u_1
inst✝¹ : Group G
H K L : Subgroup G
G' : Type u_2
inst✝ : Group G'
f : G' →* G
hf : Function.Surjective ⇑f
this✝ : Setoid G := QuotientGroup.leftRel H
this : Setoid G' := QuotientGroup.leftRel (comap f H)
key : ∀ (x y : G'), Setoid.r x y ↔ Setoid.r (f x) (f y)
⊢ Function.Injective (Quotient.map' ⇑f ⋯)
state_after: case refine_1
G : Type u_1
inst✝¹ : Group G
H K L : Subgroup G
G' : Type u_2
inst✝ : Group G'
f : G' →* G
hf : Function.Surjective ⇑f
this✝ : Setoid G := QuotientGroup.leftRel H
this : Setoid G' := QuotientGroup.leftRel (comap f H)
key✝ : ∀ (x y : G'), Setoid.r x y ↔ Setoid.r (f x) (f y)
key : ∀ (x y : G'), Quotient.mk'' x = Quotient.mk'' y ↔ Quotient.mk'' (f x) = Quotient.mk'' (f y)
⊢ Function.Injective (Quotient.map' ⇑f ⋯)

tactic: refine Quotient.ind' fun x => ?_
state_before: case refine_1
G : Type u_1
inst✝¹ : Group G
H K L : Subgroup G
G' : Type u_2
inst✝ : Group G'
f : G' →* G
hf : Function.Surjective ⇑f
this✝ : Setoid G := QuotientGroup.leftRel H
this : Setoid G' := QuotientGroup.leftRel (comap f H)
key✝ : ∀ (x y : G'), Setoid.r x y ↔ Setoid.r (f x) (f y)
key : ∀ (x y : G'), Quotient.mk'' x = Quotient.mk'' y ↔ Quotient.mk'' (f x) = Quotient.mk'' (f y)
⊢ Function.Injective (Quotient.map' ⇑f ⋯)
state_after: case refine_1
G : Type u_1
inst✝¹ : Group G
H K L : Subgroup G
G' : Type u_2
inst✝ : Group G'
f : G' →* G
hf : Function.Surjective ⇑f
this✝ : Setoid G := QuotientGroup.leftRel H
this : Setoid G' := QuotientGroup.leftRel (comap f H)
key✝ : ∀ (x y : G'), Setoid.r x y ↔ Setoid.r (f x) (f y)
key : ∀ (x y : G'), Quotient.mk'' x = Quotient.mk'' y ↔ Quotient.mk'' (f x) = Quotient.mk'' (f y)
x : G'
⊢ ∀ ⦃a₂ : G' ⧸ comap f H⦄, Quotient.map' ⇑f ⋯ (Quotient.mk'' x) = Quotient.map' ⇑f ⋯ a₂ → Quotient.mk'' x = a₂

tactic: refine Quotient.ind' fun y => ?_
state_before: case refine_1
G : Type u_1
inst✝¹ : Group G
H K L : Subgroup G
G' : Type u_2
inst✝ : Group G'
f : G' →* G
hf : Function.Surjective ⇑f
this✝ : Setoid G := QuotientGroup.leftRel H
this : Setoid G' := QuotientGroup.leftRel (comap f H)
key✝ : ∀ (x y : G'), Setoid.r x y ↔ Setoid.r (f x) (f y)
key : ∀ (x y : G'), Quotient.mk'' x = Quotient.mk'' y ↔ Quotient.mk'' (f x) = Quotient.mk'' (f y)
x : G'
⊢ ∀ ⦃a₂ : G' ⧸ comap f H⦄, Quotient.map' ⇑f ⋯ (Quotient.mk'' x) = Quotient.map' ⇑f ⋯ a₂ → Quotient.mk'' x = a₂
state_after: case refine_1
G : Type u_1
inst✝¹ : Group G
H K L : Subgroup G
G' : Type u_2
inst✝ : Group G'
f : G' →* G
hf : Function.Surjective ⇑f
this✝ : Setoid G := QuotientGroup.leftRel H
this : Setoid G' := QuotientGroup.leftRel (comap f H)
key✝ : ∀ (x y : G'), Setoid.r x y ↔ Setoid.r (f x) (f y)
key : ∀ (x y : G'), Quotient.mk'' x = Quotient.mk'' y ↔ Quotient.mk'' (f x) = Quotient.mk'' (f y)
x y : G'
⊢ Quotient.map' ⇑f ⋯ (Quotient.mk'' x) = Quotient.map' ⇑f ⋯ (Quotient.mk'' y) → Quotient.mk'' x = Quotient.mk'' y

tactic: exact (key x y).mpr
state_before: case refine_1
G : Type u_1
inst✝¹ : Group G
H K L : Subgroup G
G' : Type u_2
inst✝ : Group G'
f : G' →* G
hf : Function.Surjective ⇑f
this✝ : Setoid G := QuotientGroup.leftRel H
this : Setoid G' := QuotientGroup.leftRel (comap f H)
key✝ : ∀ (x y : G'), Setoid.r x y ↔ Setoid.r (f x) (f y)
key : ∀ (x y : G'), Quotient.mk'' x = Quotient.mk'' y ↔ Quotient.mk'' (f x) = Quotient.mk'' (f y)
x y : G'
⊢ Quotient.map' ⇑f ⋯ (Quotient.mk'' x) = Quotient.map' ⇑f ⋯ (Quotient.mk'' y) → Quotient.mk'' x = Quotient.mk'' y
state_after: no goals

tactic: refine Quotient.ind' fun x => ?_
state_before: case refine_2
G : Type u_1
inst✝¹ : Group G
H K L : Subgroup G
G' : Type u_2
inst✝ : Group G'
f : G' →* G
hf : Function.Surjective ⇑f
this✝ : Setoid G := QuotientGroup.leftRel H
this : Setoid G' := QuotientGroup.leftRel (comap f H)
key : ∀ (x y : G'), Setoid.r x y ↔ Setoid.r (f x) (f y)
⊢ Function.Surjective (Quotient.map' ⇑f ⋯)
state_after: case refine_2
G : Type u_1
inst✝¹ : Group G
H K L : Subgroup G
G' : Type u_2
inst✝ : Group G'
f : G' →* G
hf : Function.Surjective ⇑f
this✝ : Setoid G := QuotientGroup.leftRel H
this : Setoid G' := QuotientGroup.leftRel (comap f H)
key : ∀ (x y : G'), Setoid.r x y ↔ Setoid.r (f x) (f y)
x : G
⊢ ∃ a, Quotient.map' ⇑f ⋯ a = Quotient.mk'' x

tactic: obtain ⟨y, hy⟩ := hf x
state_before: case refine_2
G : Type u_1
inst✝¹ : Group G
H K L : Subgroup G
G' : Type u_2
inst✝ : Group G'
f : G' →* G
hf : Function.Surjective ⇑f
this✝ : Setoid G := QuotientGroup.leftRel H
this : Setoid G' := QuotientGroup.leftRel (comap f H)
key : ∀ (x y : G'), Setoid.r x y ↔ Setoid.r (f x) (f y)
x : G
⊢ ∃ a, Quotient.map' ⇑f ⋯ a = Quotient.mk'' x
state_after: case refine_2.intro
G : Type u_1
inst✝¹ : Group G
H K L : Subgroup G
G' : Type u_2
inst✝ : Group G'
f : G' →* G
hf : Function.Surjective ⇑f
this✝ : Setoid G := QuotientGroup.leftRel H
this : Setoid G' := QuotientGroup.leftRel (comap f H)
key : ∀ (x y : G'), Setoid.r x y ↔ Setoid.r (f x) (f y)
x : G
y : G'
hy : f y = x
⊢ ∃ a, Quotient.map' ⇑f ⋯ a = Quotient.mk'' x

tactic: exact ⟨y, (Quotient.map'_mk'' f _ y).trans (congr_arg Quotient.mk'' hy)⟩
state_before: case refine_2.intro
G : Type u_1
inst✝¹ : Group G
H K L : Subgroup G
G' : Type u_2
inst✝ : Group G'
f : G' →* G
hf : Function.Surjective ⇑f
this✝ : Setoid G := QuotientGroup.leftRel H
this : Setoid G' := QuotientGroup.leftRel (comap f H)
key : ∀ (x y : G'), Setoid.r x y ↔ Setoid.r (f x) (f y)
x : G
y : G'
hy : f y = x
⊢ ∃ a, Quotient.map' ⇑f ⋯ a = Quotient.mk'' x
state_after: no goals