Theorem: Subgroup.exists_right_transversal_of_le
File: Mathlib/GroupTheory/Complement.lean

tactic: let H'' : Subgroup H := H'.comap H.subtype
state_before: G : Type u_1
inst✝ : Group G
H✝ K : Subgroup G
S T : Set G
H' H : Subgroup G
h : H' ≤ H
⊢ ∃ S, ↑H' * S = ↑H ∧ Nat.card ↥H' * Nat.card ↑S = Nat.card ↥H
state_after: G : Type u_1
inst✝ : Group G
H✝ K : Subgroup G
S T : Set G
H' H : Subgroup G
h : H' ≤ H
H'' : Subgroup ↥H := comap H.subtype H'
⊢ ∃ S, ↑H' * S = ↑H ∧ Nat.card ↥H' * Nat.card ↑S = Nat.card ↥H

tactic: have : H' = H''.map H.subtype := by simp [H'', h]
state_before: G : Type u_1
inst✝ : Group G
H✝ K : Subgroup G
S T : Set G
H' H : Subgroup G
h : H' ≤ H
H'' : Subgroup ↥H := comap H.subtype H'
⊢ ∃ S, ↑H' * S = ↑H ∧ Nat.card ↥H' * Nat.card ↑S = Nat.card ↥H
state_after: G : Type u_1
inst✝ : Group G
H✝ K : Subgroup G
S T : Set G
H' H : Subgroup G
h : H' ≤ H
H'' : Subgroup ↥H := comap H.subtype H'
this : H' = map H.subtype H''
⊢ ∃ S, ↑H' * S = ↑H ∧ Nat.card ↥H' * Nat.card ↑S = Nat.card ↥H

tactic: rw [this]
state_before: G : Type u_1
inst✝ : Group G
H✝ K : Subgroup G
S T : Set G
H' H : Subgroup G
h : H' ≤ H
H'' : Subgroup ↥H := comap H.subtype H'
this : H' = map H.subtype H''
⊢ ∃ S, ↑H' * S = ↑H ∧ Nat.card ↥H' * Nat.card ↑S = Nat.card ↥H
state_after: G : Type u_1
inst✝ : Group G
H✝ K : Subgroup G
S T : Set G
H' H : Subgroup G
h : H' ≤ H
H'' : Subgroup ↥H := comap H.subtype H'
this : H' = map H.subtype H''
⊢ ∃ S, ↑(map H.subtype H'') * S = ↑H ∧ Nat.card ↥(map H.subtype H'') * Nat.card ↑S = Nat.card ↥H

tactic: obtain ⟨S, cmem, -⟩ := H''.exists_right_transversal 1
state_before: G : Type u_1
inst✝ : Group G
H✝ K : Subgroup G
S T : Set G
H' H : Subgroup G
h : H' ≤ H
H'' : Subgroup ↥H := comap H.subtype H'
this : H' = map H.subtype H''
⊢ ∃ S, ↑(map H.subtype H'') * S = ↑H ∧ Nat.card ↥(map H.subtype H'') * Nat.card ↑S = Nat.card ↥H
state_after: case intro.intro
G : Type u_1
inst✝ : Group G
H✝ K : Subgroup G
S✝ T : Set G
H' H : Subgroup G
h : H' ≤ H
H'' : Subgroup ↥H := comap H.subtype H'
this : H' = map H.subtype H''
S : Set ↥H
cmem : S ∈ rightTransversals ↑H''
⊢ ∃ S, ↑(map H.subtype H'') * S = ↑H ∧ Nat.card ↥(map H.subtype H'') * Nat.card ↑S = Nat.card ↥H

tactic: refine ⟨H.subtype '' S, ?_, ?_⟩
state_before: case intro.intro
G : Type u_1
inst✝ : Group G
H✝ K : Subgroup G
S✝ T : Set G
H' H : Subgroup G
h : H' ≤ H
H'' : Subgroup ↥H := comap H.subtype H'
this : H' = map H.subtype H''
S : Set ↥H
cmem : S ∈ rightTransversals ↑H''
⊢ ∃ S, ↑(map H.subtype H'') * S = ↑H ∧ Nat.card ↥(map H.subtype H'') * Nat.card ↑S = Nat.card ↥H
state_after: case intro.intro.refine_1
G : Type u_1
inst✝ : Group G
H✝ K : Subgroup G
S✝ T : Set G
H' H : Subgroup G
h : H' ≤ H
H'' : Subgroup ↥H := comap H.subtype H'
this : H' = map H.subtype H''
S : Set ↥H
cmem : S ∈ rightTransversals ↑H''
⊢ ↑(map H.subtype H'') * ⇑H.subtype '' S = ↑H

case intro.intro.refine_2
G : Type u_1
inst✝ : Group G
H✝ K : Subgroup G
S✝ T : Set G
H' H : Subgroup G
h : H' ≤ H
H'' : Subgroup ↥H := comap H.subtype H'
this : H' = map H.subtype H''
S : Set ↥H
cmem : S ∈ rightTransversals ↑H''
⊢ Nat.card ↥(map H.subtype H'') * Nat.card ↑(⇑H.subtype '' S) = Nat.card ↥H

tactic: simp [H'', h]
state_before: G : Type u_1
inst✝ : Group G
H✝ K : Subgroup G
S T : Set G
H' H : Subgroup G
h : H' ≤ H
H'' : Subgroup ↥H := comap H.subtype H'
⊢ H' = map H.subtype H''
state_after: no goals

tactic: have : H.subtype '' (H'' * S) = H''.map H.subtype * H.subtype '' S := image_mul H.subtype
state_before: case intro.intro.refine_1
G : Type u_1
inst✝ : Group G
H✝ K : Subgroup G
S✝ T : Set G
H' H : Subgroup G
h : H' ≤ H
H'' : Subgroup ↥H := comap H.subtype H'
this : H' = map H.subtype H''
S : Set ↥H
cmem : S ∈ rightTransversals ↑H''
⊢ ↑(map H.subtype H'') * ⇑H.subtype '' S = ↑H
state_after: case intro.intro.refine_1
G : Type u_1
inst✝ : Group G
H✝ K : Subgroup G
S✝ T : Set G
H' H : Subgroup G
h : H' ≤ H
H'' : Subgroup ↥H := comap H.subtype H'
this✝ : H' = map H.subtype H''
S : Set ↥H
cmem : S ∈ rightTransversals ↑H''
this : ⇑H.subtype '' (↑H'' * S) = ↑(map H.subtype H'') * ⇑H.subtype '' S
⊢ ↑(map H.subtype H'') * ⇑H.subtype '' S = ↑H

tactic: rw [← this, cmem.mul_eq]
state_before: case intro.intro.refine_1
G : Type u_1
inst✝ : Group G
H✝ K : Subgroup G
S✝ T : Set G
H' H : Subgroup G
h : H' ≤ H
H'' : Subgroup ↥H := comap H.subtype H'
this✝ : H' = map H.subtype H''
S : Set ↥H
cmem : S ∈ rightTransversals ↑H''
this : ⇑H.subtype '' (↑H'' * S) = ↑(map H.subtype H'') * ⇑H.subtype '' S
⊢ ↑(map H.subtype H'') * ⇑H.subtype '' S = ↑H
state_after: case intro.intro.refine_1
G : Type u_1
inst✝ : Group G
H✝ K : Subgroup G
S✝ T : Set G
H' H : Subgroup G
h : H' ≤ H
H'' : Subgroup ↥H := comap H.subtype H'
this✝ : H' = map H.subtype H''
S : Set ↥H
cmem : S ∈ rightTransversals ↑H''
this : ⇑H.subtype '' (↑H'' * S) = ↑(map H.subtype H'') * ⇑H.subtype '' S
⊢ ⇑H.subtype '' univ = ↑H

tactic: simp [Set.ext_iff]
state_before: case intro.intro.refine_1
G : Type u_1
inst✝ : Group G
H✝ K : Subgroup G
S✝ T : Set G
H' H : Subgroup G
h : H' ≤ H
H'' : Subgroup ↥H := comap H.subtype H'
this✝ : H' = map H.subtype H''
S : Set ↥H
cmem : S ∈ rightTransversals ↑H''
this : ⇑H.subtype '' (↑H'' * S) = ↑(map H.subtype H'') * ⇑H.subtype '' S
⊢ ⇑H.subtype '' univ = ↑H
state_after: no goals

tactic: have : Nat.card H'' * Nat.card S = Nat.card H := cmem.card_mul_card
state_before: case intro.intro.refine_2
G : Type u_1
inst✝ : Group G
H✝ K : Subgroup G
S✝ T : Set G
H' H : Subgroup G
h : H' ≤ H
H'' : Subgroup ↥H := comap H.subtype H'
this : H' = map H.subtype H''
S : Set ↥H
cmem : S ∈ rightTransversals ↑H''
⊢ Nat.card ↥(map H.subtype H'') * Nat.card ↑(⇑H.subtype '' S) = Nat.card ↥H
state_after: case intro.intro.refine_2
G : Type u_1
inst✝ : Group G
H✝ K : Subgroup G
S✝ T : Set G
H' H : Subgroup G
h : H' ≤ H
H'' : Subgroup ↥H := comap H.subtype H'
this✝ : H' = map H.subtype H''
S : Set ↥H
cmem : S ∈ rightTransversals ↑H''
this : Nat.card ↥H'' * Nat.card ↑S = Nat.card ↥H
⊢ Nat.card ↥(map H.subtype H'') * Nat.card ↑(⇑H.subtype '' S) = Nat.card ↥H

tactic: rw [← this]
state_before: case intro.intro.refine_2
G : Type u_1
inst✝ : Group G
H✝ K : Subgroup G
S✝ T : Set G
H' H : Subgroup G
h : H' ≤ H
H'' : Subgroup ↥H := comap H.subtype H'
this✝ : H' = map H.subtype H''
S : Set ↥H
cmem : S ∈ rightTransversals ↑H''
this : Nat.card ↥H'' * Nat.card ↑S = Nat.card ↥H
⊢ Nat.card ↥(map H.subtype H'') * Nat.card ↑(⇑H.subtype '' S) = Nat.card ↥H
state_after: case intro.intro.refine_2
G : Type u_1
inst✝ : Group G
H✝ K : Subgroup G
S✝ T : Set G
H' H : Subgroup G
h : H' ≤ H
H'' : Subgroup ↥H := comap H.subtype H'
this✝ : H' = map H.subtype H''
S : Set ↥H
cmem : S ∈ rightTransversals ↑H''
this : Nat.card ↥H'' * Nat.card ↑S = Nat.card ↥H
⊢ Nat.card ↥(map H.subtype H'') * Nat.card ↑(⇑H.subtype '' S) = Nat.card ↥H'' * Nat.card ↑S