l3lab/ntp-mathlib huggingface dataset:
/-- Given two subgroups `H' ⊆ H`, there exists a left transversal to `H'` inside `H`. -/
@[to_additive "Given two subgroups `H' ⊆ H`, there exists a transversal to `H'` inside `H`"]
lemma exists_left_transversal_of_le {H' H : Subgroup G} (h : H' ≤ H) :
    ∃ S : Set G, S * H' = H ∧ Nat.card S * Nat.card H' = Nat.card H := by
  let H'' : Subgroup H := H'.comap H.subtype
  have : H' = H''.map H.subtype := by simp [h]
  rw [this]
  obtain ⟨S, cmem, -⟩ := H''.exists_left_transversal 1
  refine ⟨H.subtype '' S, ?_, ?_⟩
  · have : H.subtype '' (S * H'') = H.subtype '' S * H''.map H.subtype := image_mul H.subtype
    rw [← this, cmem.mul_eq]
    simp [Set.ext_iff]
  · rw [← cmem.card_mul_card]
    refine congr_arg₂ (· * ·) ?_ ?_ <;>
      

Proof state:
case intro.intro.refine_2.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 (Subgroup.subtype H) H'
this : H' = map (Subgroup.subtype H) H''
S : Set ↥H
cmem : S ∈ leftTransversals ↑H''
⊢ Nat.card ↥(map (Subgroup.subtype H) H'') = Nat.card ↑↑H''

Next tactic:
exact Nat.card_congr (Equiv.Set.image _ _ $ subtype_injective H).symm
/-- Given two subgroups `H' ⊆ H`, there exists a right transversal to `H'` inside `H`. -/
@[to_additive "Given two subgroups `H' ⊆ H`, there exists a transversal to `H'` inside `H`"]
lemma exists_right_transversal_of_le {H' H : Subgroup G} (h : H' ≤ H) :
    ∃ S : Set G, H' * S = H ∧ Nat.card H' * Nat.card S = Nat.card H := by
  

Proof state:
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

Next tactic:
let H'' : Subgroup H := H'.comap H.subtype
/-- Given two subgroups `H' ⊆ H`, there exists a right transversal to `H'` inside `H`. -/
@[to_additive "Given two subgroups `H' ⊆ H`, there exists a transversal to `H'` inside `H`"]
lemma exists_right_transversal_of_le {H' H : Subgroup G} (h : H' ≤ H) :
    ∃ S : Set G, H' * S = H ∧ Nat.card H' * Nat.card S = Nat.card H := by
  let H'' : Subgroup H := H'.comap H.subtype
  

Proof state:
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 (Subgroup.subtype H) H'
⊢ ∃ S, ↑H' * S = ↑H ∧ Nat.card ↥H' * Nat.card ↑S = Nat.card ↥H

Next tactic:
have : H' = H''.map H.subtype := by simp [h]
/-- Given two subgroups `H' ⊆ H`, there exists a right transversal to `H'` inside `H`. -/
@[to_additive "Given two subgroups `H' ⊆ H`, there exists a transversal to `H'` inside `H`"]
lemma exists_right_transversal_of_le {H' H : Subgroup G} (h : H' ≤ H) :
    ∃ S : Set G, H' * S = H ∧ Nat.card H' * Nat.card S = Nat.card H := by
  let H'' : Subgroup H := H'.comap H.subtype
  have : H' = H''.map H.subtype := by 

Proof state:
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 (Subgroup.subtype H) H'
⊢ H' = map (Subgroup.subtype H) H''

Next tactic:
simp [h]
/-- Given two subgroups `H' ⊆ H`, there exists a right transversal to `H'` inside `H`. -/
@[to_additive "Given two subgroups `H' ⊆ H`, there exists a transversal to `H'` inside `H`"]
lemma exists_right_transversal_of_le {H' H : Subgroup G} (h : H' ≤ H) :
    ∃ S : Set G, H' * S = H ∧ Nat.card H' * Nat.card S = Nat.card H := by
  let H'' : Subgroup H := H'.comap H.subtype
  have : H' = H''.map H.subtype := by simp [h]
  

Proof state:
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 (Subgroup.subtype H) H'
this : H' = map (Subgroup.subtype H) H''
⊢ ∃ S, ↑H' * S = ↑H ∧ Nat.card ↥H' * Nat.card ↑S = Nat.card ↥H

Next tactic:
rw [this]
/-- Given two subgroups `H' ⊆ H`, there exists a right transversal to `H'` inside `H`. -/
@[to_additive "Given two subgroups `H' ⊆ H`, there exists a transversal to `H'` inside `H`"]
lemma exists_right_transversal_of_le {H' H : Subgroup G} (h : H' ≤ H) :
    ∃ S : Set G, H' * S = H ∧ Nat.card H' * Nat.card S = Nat.card H := by
  let H'' : Subgroup H := H'.comap H.subtype
  have : H' = H''.map H.subtype := by simp [h]
  rw [this]
  

Proof state:
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 (Subgroup.subtype H) H'
this : H' = map (Subgroup.subtype H) H''
⊢ ∃ S, ↑(map (Subgroup.subtype H) H'') * S = ↑H ∧ Nat.card ↥(map (Subgroup.subtype H) H'') * Nat.card ↑S = Nat.card ↥H

Next tactic:
obtain ⟨S, cmem, -⟩ := H''.exists_right_transversal 1
/-- Given two subgroups `H' ⊆ H`, there exists a right transversal to `H'` inside `H`. -/
@[to_additive "Given two subgroups `H' ⊆ H`, there exists a transversal to `H'` inside `H`"]
lemma exists_right_transversal_of_le {H' H : Subgroup G} (h : H' ≤ H) :
    ∃ S : Set G, H' * S = H ∧ Nat.card H' * Nat.card S = Nat.card H := by
  let H'' : Subgroup H := H'.comap H.subtype
  have : H' = H''.map H.subtype := by simp [h]
  rw [this]
  obtain ⟨S, cmem, -⟩ := H''.exists_right_transversal 1
  

Proof state:
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 (Subgroup.subtype H) H'
this : H' = map (Subgroup.subtype H) H''
S : Set ↥H
cmem : S ∈ rightTransversals ↑H''
⊢ ∃ S, ↑(map (Subgroup.subtype H) H'') * S = ↑H ∧ Nat.card ↥(map (Subgroup.subtype H) H'') * Nat.card ↑S = Nat.card ↥H

Next tactic:
refine ⟨H.subtype '' S, ?_, ?_⟩
/-- Given two subgroups `H' ⊆ H`, there exists a right transversal to `H'` inside `H`. -/
@[to_additive "Given two subgroups `H' ⊆ H`, there exists a transversal to `H'` inside `H`"]
lemma exists_right_transversal_of_le {H' H : Subgroup G} (h : H' ≤ H) :
    ∃ S : Set G, H' * S = H ∧ Nat.card H' * Nat.card S = Nat.card H := by
  let H'' : Subgroup H := H'.comap H.subtype
  have : H' = H''.map H.subtype := by simp [h]
  rw [this]
  obtain ⟨S, cmem, -⟩ := H''.exists_right_transversal 1
  refine ⟨H.subtype '' S, ?_, ?_⟩
  · 

Proof state:
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 (Subgroup.subtype H) H'
this : H' = map (Subgroup.subtype H) H''
S : Set ↥H
cmem : S ∈ rightTransversals ↑H''
⊢ ↑(map (Subgroup.subtype H) H'') * ⇑(Subgroup.subtype H) '' S = ↑H

Next tactic:
have : H.subtype '' (H'' * S) = H''.map H.subtype * H.subtype '' S := image_mul H.subtype
/-- Given two subgroups `H' ⊆ H`, there exists a right transversal to `H'` inside `H`. -/
@[to_additive "Given two subgroups `H' ⊆ H`, there exists a transversal to `H'` inside `H`"]
lemma exists_right_transversal_of_le {H' H : Subgroup G} (h : H' ≤ H) :
    ∃ S : Set G, H' * S = H ∧ Nat.card H' * Nat.card S = Nat.card H := by
  let H'' : Subgroup H := H'.comap H.subtype
  have : H' = H''.map H.subtype := by simp [h]
  rw [this]
  obtain ⟨S, cmem, -⟩ := H''.exists_right_transversal 1
  refine ⟨H.subtype '' S, ?_, ?_⟩
  · have : H.subtype '' (H'' * S) = H''.map H.subtype * H.subtype '' S := image_mul H.subtype
    

Proof state:
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 (Subgroup.subtype H) H'
this✝ : H' = map (Subgroup.subtype H) H''
S : Set ↥H
cmem : S ∈ rightTransversals ↑H''
this : ⇑(Subgroup.subtype H) '' (↑H'' * S) = ↑(map (Subgroup.subtype H) H'') * ⇑(Subgroup.subtype H) '' S
⊢ ↑(map (Subgroup.subtype H) H'') * ⇑(Subgroup.subtype H) '' S = ↑H

Next tactic:
rw [← this, cmem.mul_eq]
/-- Given two subgroups `H' ⊆ H`, there exists a right transversal to `H'` inside `H`. -/
@[to_additive "Given two subgroups `H' ⊆ H`, there exists a transversal to `H'` inside `H`"]
lemma exists_right_transversal_of_le {H' H : Subgroup G} (h : H' ≤ H) :
    ∃ S : Set G, H' * S = H ∧ Nat.card H' * Nat.card S = Nat.card H := by
  let H'' : Subgroup H := H'.comap H.subtype
  have : H' = H''.map H.subtype := by simp [h]
  rw [this]
  obtain ⟨S, cmem, -⟩ := H''.exists_right_transversal 1
  refine ⟨H.subtype '' S, ?_, ?_⟩
  · have : H.subtype '' (H'' * S) = H''.map H.subtype * H.subtype '' S := image_mul H.subtype
    rw [← this, cmem.mul_eq]
    

Proof state:
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 (Subgroup.subtype H) H'
this✝ : H' = map (Subgroup.subtype H) H''
S : Set ↥H
cmem : S ∈ rightTransversals ↑H''
this : ⇑(Subgroup.subtype H) '' (↑H'' * S) = ↑(map (Subgroup.subtype H) H'') * ⇑(Subgroup.subtype H) '' S
⊢ ⇑(Subgroup.subtype H) '' univ = ↑H

Next tactic:
simp [Set.ext_iff]
/-- Given two subgroups `H' ⊆ H`, there exists a right transversal to `H'` inside `H`. -/
@[to_additive "Given two subgroups `H' ⊆ H`, there exists a transversal to `H'` inside `H`"]
lemma exists_right_transversal_of_le {H' H : Subgroup G} (h : H' ≤ H) :
    ∃ S : Set G, H' * S = H ∧ Nat.card H' * Nat.card S = Nat.card H := by
  let H'' : Subgroup H := H'.comap H.subtype
  have : H' = H''.map H.subtype := by simp [h]
  rw [this]
  obtain ⟨S, cmem, -⟩ := H''.exists_right_transversal 1
  refine ⟨H.subtype '' S, ?_, ?_⟩
  · have : H.subtype '' (H'' * S) = H''.map H.subtype * H.subtype '' S := image_mul H.subtype
    rw [← this, cmem.mul_eq]
    simp [Set.ext_iff]
  · 

Proof state:
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 (Subgroup.subtype H) H'
this : H' = map (Subgroup.subtype H) H''
S : Set ↥H
cmem : S ∈ rightTransversals ↑H''
⊢ Nat.card ↥(map (Subgroup.subtype H) H'') * Nat.card ↑(⇑(Subgroup.subtype H) '' S) = Nat.card ↥H

Next tactic:
have : Nat.card H'' * Nat.card S = Nat.card H := cmem.card_mul_card
/-- Given two subgroups `H' ⊆ H`, there exists a right transversal to `H'` inside `H`. -/
@[to_additive "Given two subgroups `H' ⊆ H`, there exists a transversal to `H'` inside `H`"]
lemma exists_right_transversal_of_le {H' H : Subgroup G} (h : H' ≤ H) :
    ∃ S : Set G, H' * S = H ∧ Nat.card H' * Nat.card S = Nat.card H := by
  let H'' : Subgroup H := H'.comap H.subtype
  have : H' = H''.map H.subtype := by simp [h]
  rw [this]
  obtain ⟨S, cmem, -⟩ := H''.exists_right_transversal 1
  refine ⟨H.subtype '' S, ?_, ?_⟩
  · have : H.subtype '' (H'' * S) = H''.map H.subtype * H.subtype '' S := image_mul H.subtype
    rw [← this, cmem.mul_eq]
    simp [Set.ext_iff]
  · have : Nat.card H'' * Nat.card S = Nat.card H := cmem.card_mul_card
    

Proof state:
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 (Subgroup.subtype H) H'
this✝ : H' = map (Subgroup.subtype H) H''
S : Set ↥H
cmem : S ∈ rightTransversals ↑H''
this : Nat.card ↥H'' * Nat.card ↑S = Nat.card ↥H
⊢ Nat.card ↥(map (Subgroup.subtype H) H'') * Nat.card ↑(⇑(Subgroup.subtype H) '' S) = Nat.card ↥H

Next tactic:
rw [← this]
/-- Given two subgroups `H' ⊆ H`, there exists a right transversal to `H'` inside `H`. -/
@[to_additive "Given two subgroups `H' ⊆ H`, there exists a transversal to `H'` inside `H`"]
lemma exists_right_transversal_of_le {H' H : Subgroup G} (h : H' ≤ H) :
    ∃ S : Set G, H' * S = H ∧ Nat.card H' * Nat.card S = Nat.card H := by
  let H'' : Subgroup H := H'.comap H.subtype
  have : H' = H''.map H.subtype := by simp [h]
  rw [this]
  obtain ⟨S, cmem, -⟩ := H''.exists_right_transversal 1
  refine ⟨H.subtype '' S, ?_, ?_⟩
  · have : H.subtype '' (H'' * S) = H''.map H.subtype * H.subtype '' S := image_mul H.subtype
    rw [← this, cmem.mul_eq]
    simp [Set.ext_iff]
  · have : Nat.card H'' * Nat.card S = Nat.card H := cmem.card_mul_card
    rw [← this]
    

Proof state:
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 (Subgroup.subtype H) H'
this✝ : H' = map (Subgroup.subtype H) H''
S : Set ↥H
cmem : S ∈ rightTransversals ↑H''
this : Nat.card ↥H'' * Nat.card ↑S = Nat.card ↥H
⊢ Nat.card ↥(map (Subgroup.subtype H) H'') * Nat.card ↑(⇑(Subgroup.subtype H) '' S) = Nat.card ↥H'' * Nat.card ↑S

Next tactic:
refine congr_arg₂ (· * ·) ?_ ?_
/-- Given two subgroups `H' ⊆ H`, there exists a right transversal to `H'` inside `H`. -/
@[to_additive "Given two subgroups `H' ⊆ H`, there exists a transversal to `H'` inside `H`"]
lemma exists_right_transversal_of_le {H' H : Subgroup G} (h : H' ≤ H) :
    ∃ S : Set G, H' * S = H ∧ Nat.card H' * Nat.card S = Nat.card H := by
  let H'' : Subgroup H := H'.comap H.subtype
  have : H' = H''.map H.subtype := by simp [h]
  rw [this]
  obtain ⟨S, cmem, -⟩ := H''.exists_right_transversal 1
  refine ⟨H.subtype '' S, ?_, ?_⟩
  · have : H.subtype '' (H'' * S) = H''.map H.subtype * H.subtype '' S := image_mul H.subtype
    rw [← this, cmem.mul_eq]
    simp [Set.ext_iff]
  · have : Nat.card H'' * Nat.card S = Nat.card H := cmem.card_mul_card
    rw [← this]
    refine congr_arg₂ (· * ·) ?_ ?_ <;>
      

Proof state:
case intro.intro.refine_2.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 (Subgroup.subtype H) H'
this✝ : H' = map (Subgroup.subtype H) H''
S : Set ↥H
cmem : S ∈ rightTransversals ↑H''
this : Nat.card ↥H'' * Nat.card ↑S = Nat.card ↥H
⊢ Nat.card ↥(map (Subgroup.subtype H) H'') = Nat.card ↥H''

Next tactic:
exact Nat.card_congr (Equiv.Set.image _ _ $ subtype_injective H).symm
/-- Given two subgroups `H' ⊆ H`, there exists a right transversal to `H'` inside `H`. -/
@[to_additive "Given two subgroups `H' ⊆ H`, there exists a transversal to `H'` inside `H`"]
lemma exists_right_transversal_of_le {H' H : Subgroup G} (h : H' ≤ H) :
    ∃ S : Set G, H' * S = H ∧ Nat.card H' * Nat.card S = Nat.card H := by
  let H'' : Subgroup H := H'.comap H.subtype
  have : H' = H''.map H.subtype := by simp [h]
  rw [this]
  obtain ⟨S, cmem, -⟩ := H''.exists_right_transversal 1
  refine ⟨H.subtype '' S, ?_, ?_⟩
  · have : H.subtype '' (H'' * S) = H''.map H.subtype * H.subtype '' S := image_mul H.subtype
    rw [← this, cmem.mul_eq]
    simp [Set.ext_iff]
  · have : Nat.card H'' * Nat.card S = Nat.card H := cmem.card_mul_card
    rw [← this]
    refine congr_arg₂ (· * ·) ?_ ?_ <;>
      

Proof state:
case intro.intro.refine_2.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 (Subgroup.subtype H) H'
this✝ : H' = map (Subgroup.subtype H) H''
S : Set ↥H
cmem : S ∈ rightTransversals ↑H''
this : Nat.card ↥H'' * Nat.card ↑S = Nat.card ↥H
⊢ Nat.card ↑(⇑(Subgroup.subtype H) '' S) = Nat.card ↑S

Next tactic:
exact Nat.card_congr (Equiv.Set.image _ _ $ subtype_injective H).symm
theorem equiv_fst_eq_iff_leftCosetEquivalence {g₁ g₂ : G} :
    (hSK.equiv g₁).fst = (hSK.equiv g₂).fst ↔ LeftCosetEquivalence K g₁ g₂ := by
  

Proof state:
G : Type u_1
inst✝ : Group G
H K : Subgroup G
S T : Set G
hST : IsComplement S T
hHT : IsComplement (↑H) T
hSK : IsComplement S ↑K
g₁ g₂ : G
⊢ ((equiv hSK) g₁).1 = ((equiv hSK) g₂).1 ↔ LeftCosetEquivalence (↑K) g₁ g₂

Next tactic:
rw [LeftCosetEquivalence, leftCoset_eq_iff]
theorem equiv_fst_eq_iff_leftCosetEquivalence {g₁ g₂ : G} :
    (hSK.equiv g₁).fst = (hSK.equiv g₂).fst ↔ LeftCosetEquivalence K g₁ g₂ := by
  rw [LeftCosetEquivalence, leftCoset_eq_iff]
  

Proof state:
G : Type u_1
inst✝ : Group G
H K : Subgroup G
S T : Set G
hST : IsComplement S T
hHT : IsComplement (↑H) T
hSK : IsComplement S ↑K
g₁ g₂ : G
⊢ ((equiv hSK) g₁).1 = ((equiv hSK) g₂).1 ↔ g₁⁻¹ * g₂ ∈ K

Next tactic:
constructor
theorem equiv_fst_eq_iff_leftCosetEquivalence {g₁ g₂ : G} :
    (hSK.equiv g₁).fst = (hSK.equiv g₂).fst ↔ LeftCosetEquivalence K g₁ g₂ := by
  rw [LeftCosetEquivalence, leftCoset_eq_iff]
  constructor
  · 

Proof state:
case mp
G : Type u_1
inst✝ : Group G
H K : Subgroup G
S T : Set G
hST : IsComplement S T
hHT : IsComplement (↑H) T
hSK : IsComplement S ↑K
g₁ g₂ : G
⊢ ((equiv hSK) g₁).1 = ((equiv hSK) g₂).1 → g₁⁻¹ * g₂ ∈ K

Next tactic:
intro h
theorem equiv_fst_eq_iff_leftCosetEquivalence {g₁ g₂ : G} :
    (hSK.equiv g₁).fst = (hSK.equiv g₂).fst ↔ LeftCosetEquivalence K g₁ g₂ := by
  rw [LeftCosetEquivalence, leftCoset_eq_iff]
  constructor
  · intro h
    

Proof state:
case mp
G : Type u_1
inst✝ : Group G
H K : Subgroup G
S T : Set G
hST : IsComplement S T
hHT : IsComplement (↑H) T
hSK : IsComplement S ↑K
g₁ g₂ : G
h : ((equiv hSK) g₁).1 = ((equiv hSK) g₂).1
⊢ g₁⁻¹ * g₂ ∈ K

Next tactic:
rw [← hSK.equiv_fst_mul_equiv_snd g₂, ← hSK.equiv_fst_mul_equiv_snd g₁, ← h,
      mul_inv_rev, ← mul_assoc, inv_mul_cancel_right, ← coe_inv, ← coe_mul]
theorem equiv_fst_eq_iff_leftCosetEquivalence {g₁ g₂ : G} :
    (hSK.equiv g₁).fst = (hSK.equiv g₂).fst ↔ LeftCosetEquivalence K g₁ g₂ := by
  rw [LeftCosetEquivalence, leftCoset_eq_iff]
  constructor
  · intro h
    rw [← hSK.equiv_fst_mul_equiv_snd g₂, ← hSK.equiv_fst_mul_equiv_snd g₁, ← h,
      mul_inv_rev, ← mul_assoc, inv_mul_cancel_right, ← coe_inv, ← coe_mul]
    

Proof state:
case mp
G : Type u_1
inst✝ : Group G
H K : Subgroup G
S T : Set G
hST : IsComplement S T
hHT : IsComplement (↑H) T
hSK : IsComplement S ↑K
g₁ g₂ : G
h : ((equiv hSK) g₁).1 = ((equiv hSK) g₂).1
⊢ ↑(((equiv hSK) g₁).2⁻¹ * ((equiv hSK) g₂).2) ∈ K

Next tactic:
exact Subtype.property _
theorem equiv_fst_eq_iff_leftCosetEquivalence {g₁ g₂ : G} :
    (hSK.equiv g₁).fst = (hSK.equiv g₂).fst ↔ LeftCosetEquivalence K g₁ g₂ := by
  rw [LeftCosetEquivalence, leftCoset_eq_iff]
  constructor
  · intro h
    rw [← hSK.equiv_fst_mul_equiv_snd g₂, ← hSK.equiv_fst_mul_equiv_snd g₁, ← h,
      mul_inv_rev, ← mul_assoc, inv_mul_cancel_right, ← coe_inv, ← coe_mul]
    exact Subtype.property _
  · 

Proof state:
case mpr
G : Type u_1
inst✝ : Group G
H K : Subgroup G
S T : Set G
hST : IsComplement S T
hHT : IsComplement (↑H) T
hSK : IsComplement S ↑K
g₁ g₂ : G
⊢ g₁⁻¹ * g₂ ∈ K → ((equiv hSK) g₁).1 = ((equiv hSK) g₂).1

Next tactic:
intro h
theorem equiv_fst_eq_iff_leftCosetEquivalence {g₁ g₂ : G} :
    (hSK.equiv g₁).fst = (hSK.equiv g₂).fst ↔ LeftCosetEquivalence K g₁ g₂ := by
  rw [LeftCosetEquivalence, leftCoset_eq_iff]
  constructor
  · intro h
    rw [← hSK.equiv_fst_mul_equiv_snd g₂, ← hSK.equiv_fst_mul_equiv_snd g₁, ← h,
      mul_inv_rev, ← mul_assoc, inv_mul_cancel_right, ← coe_inv, ← coe_mul]
    exact Subtype.property _
  · intro h
    

Proof state:
case mpr
G : Type u_1
inst✝ : Group G
H K : Subgroup G
S T : Set G
hST : IsComplement S T
hHT : IsComplement (↑H) T
hSK : IsComplement S ↑K
g₁ g₂ : G
h : g₁⁻¹ * g₂ ∈ K
⊢ ((equiv hSK) g₁).1 = ((equiv hSK) g₂).1

Next tactic:
apply (mem_leftTransversals_iff_existsUnique_inv_mul_mem.1 hSK g₁).unique
theorem equiv_fst_eq_iff_leftCosetEquivalence {g₁ g₂ : G} :
    (hSK.equiv g₁).fst = (hSK.equiv g₂).fst ↔ LeftCosetEquivalence K g₁ g₂ := by
  rw [LeftCosetEquivalence, leftCoset_eq_iff]
  constructor
  · intro h
    rw [← hSK.equiv_fst_mul_equiv_snd g₂, ← hSK.equiv_fst_mul_equiv_snd g₁, ← h,
      mul_inv_rev, ← mul_assoc, inv_mul_cancel_right, ← coe_inv, ← coe_mul]
    exact Subtype.property _
  · intro h
    apply (mem_leftTransversals_iff_existsUnique_inv_mul_mem.1 hSK g₁).unique
    · -- This used to be `simp [...]` before leanprover/lean4#2644
      

Proof state:
case mpr.py₁
G : Type u_1
inst✝ : Group G
H K : Subgroup G
S T : Set G
hST : IsComplement S T
hHT : IsComplement (↑H) T
hSK : IsComplement S ↑K
g₁ g₂ : G
h : g₁⁻¹ * g₂ ∈ K
⊢ (↑((equiv hSK) g₁).1)⁻¹ * g₁ ∈ ↑K

Next tactic:
rw [equiv_fst_eq_mul_inv]
theorem equiv_fst_eq_iff_leftCosetEquivalence {g₁ g₂ : G} :
    (hSK.equiv g₁).fst = (hSK.equiv g₂).fst ↔ LeftCosetEquivalence K g₁ g₂ := by
  rw [LeftCosetEquivalence, leftCoset_eq_iff]
  constructor
  · intro h
    rw [← hSK.equiv_fst_mul_equiv_snd g₂, ← hSK.equiv_fst_mul_equiv_snd g₁, ← h,
      mul_inv_rev, ← mul_assoc, inv_mul_cancel_right, ← coe_inv, ← coe_mul]
    exact Subtype.property _
  · intro h
    apply (mem_leftTransversals_iff_existsUnique_inv_mul_mem.1 hSK g₁).unique
    · -- This used to be `simp [...]` before leanprover/lean4#2644
      rw [equiv_fst_eq_mul_inv]; 

Proof state:
case mpr.py₁
G : Type u_1
inst✝ : Group G
H K : Subgroup G
S T : Set G
hST : IsComplement S T
hHT : IsComplement (↑H) T
hSK : IsComplement S ↑K
g₁ g₂ : G
h : g₁⁻¹ * g₂ ∈ K
⊢ (g₁ * (↑((equiv hSK) g₁).2)⁻¹)⁻¹ * g₁ ∈ ↑K

Next tactic:
simp
theorem equiv_fst_eq_iff_leftCosetEquivalence {g₁ g₂ : G} :
    (hSK.equiv g₁).fst = (hSK.equiv g₂).fst ↔ LeftCosetEquivalence K g₁ g₂ := by
  rw [LeftCosetEquivalence, leftCoset_eq_iff]
  constructor
  · intro h
    rw [← hSK.equiv_fst_mul_equiv_snd g₂, ← hSK.equiv_fst_mul_equiv_snd g₁, ← h,
      mul_inv_rev, ← mul_assoc, inv_mul_cancel_right, ← coe_inv, ← coe_mul]
    exact Subtype.property _
  · intro h
    apply (mem_leftTransversals_iff_existsUnique_inv_mul_mem.1 hSK g₁).unique
    · -- This used to be `simp [...]` before leanprover/lean4#2644
      rw [equiv_fst_eq_mul_inv]; simp
    · 

Proof state:
case mpr.py₂
G : Type u_1
inst✝ : Group G
H K : Subgroup G
S T : Set G
hST : IsComplement S T
hHT : IsComplement (↑H) T
hSK : IsComplement S ↑K
g₁ g₂ : G
h : g₁⁻¹ * g₂ ∈ K
⊢ (↑((equiv hSK) g₂).1)⁻¹ * g₁ ∈ ↑K

Next tactic:
rw [SetLike.mem_coe, ← mul_mem_cancel_right h]
theorem equiv_fst_eq_iff_leftCosetEquivalence {g₁ g₂ : G} :
    (hSK.equiv g₁).fst = (hSK.equiv g₂).fst ↔ LeftCosetEquivalence K g₁ g₂ := by
  rw [LeftCosetEquivalence, leftCoset_eq_iff]
  constructor
  · intro h
    rw [← hSK.equiv_fst_mul_equiv_snd g₂, ← hSK.equiv_fst_mul_equiv_snd g₁, ← h,
      mul_inv_rev, ← mul_assoc, inv_mul_cancel_right, ← coe_inv, ← coe_mul]
    exact Subtype.property _
  · intro h
    apply (mem_leftTransversals_iff_existsUnique_inv_mul_mem.1 hSK g₁).unique
    · -- This used to be `simp [...]` before leanprover/lean4#2644
      rw [equiv_fst_eq_mul_inv]; simp
    · rw [SetLike.mem_coe, ← mul_mem_cancel_right h]
      -- This used to be `simp [...]` before leanprover/lean4#2644
      

Proof state:
case mpr.py₂
G : Type u_1
inst✝ : Group G
H K : Subgroup G
S T : Set G
hST : IsComplement S T
hHT : IsComplement (↑H) T
hSK : IsComplement S ↑K
g₁ g₂ : G
h : g₁⁻¹ * g₂ ∈ K
⊢ (↑((equiv hSK) g₂).1)⁻¹ * g₁ * (g₁⁻¹ * g₂) ∈ K

Next tactic:
rw [equiv_fst_eq_mul_inv]
theorem equiv_fst_eq_iff_leftCosetEquivalence {g₁ g₂ : G} :
    (hSK.equiv g₁).fst = (hSK.equiv g₂).fst ↔ LeftCosetEquivalence K g₁ g₂ := by
  rw [LeftCosetEquivalence, leftCoset_eq_iff]
  constructor
  · intro h
    rw [← hSK.equiv_fst_mul_equiv_snd g₂, ← hSK.equiv_fst_mul_equiv_snd g₁, ← h,
      mul_inv_rev, ← mul_assoc, inv_mul_cancel_right, ← coe_inv, ← coe_mul]
    exact Subtype.property _
  · intro h
    apply (mem_leftTransversals_iff_existsUnique_inv_mul_mem.1 hSK g₁).unique
    · -- This used to be `simp [...]` before leanprover/lean4#2644
      rw [equiv_fst_eq_mul_inv]; simp
    · rw [SetLike.mem_coe, ← mul_mem_cancel_right h]
      -- This used to be `simp [...]` before leanprover/lean4#2644
      rw [equiv_fst_eq_mul_inv]; 

Proof state:
case mpr.py₂
G : Type u_1
inst✝ : Group G
H K : Subgroup G
S T : Set G
hST : IsComplement S T
hHT : IsComplement (↑H) T
hSK : IsComplement S ↑K
g₁ g₂ : G
h : g₁⁻¹ * g₂ ∈ K
⊢ (g₂ * (↑((equiv hSK) g₂).2)⁻¹)⁻¹ * g₁ * (g₁⁻¹ * g₂) ∈ K

Next tactic:
simp [equiv_fst_eq_mul_inv, ← mul_assoc]
theorem equiv_snd_eq_iff_rightCosetEquivalence {g₁ g₂ : G} :
    (hHT.equiv g₁).snd = (hHT.equiv g₂).snd ↔ RightCosetEquivalence H g₁ g₂ := by
  

Proof state:
G : Type u_1
inst✝ : Group G
H K : Subgroup G
S T : Set G
hST : IsComplement S T
hHT : IsComplement (↑H) T
hSK : IsComplement S ↑K
g₁ g₂ : G
⊢ ((equiv hHT) g₁).2 = ((equiv hHT) g₂).2 ↔ RightCosetEquivalence (↑H) g₁ g₂

Next tactic:
rw [RightCosetEquivalence, rightCoset_eq_iff]
theorem equiv_snd_eq_iff_rightCosetEquivalence {g₁ g₂ : G} :
    (hHT.equiv g₁).snd = (hHT.equiv g₂).snd ↔ RightCosetEquivalence H g₁ g₂ := by
  rw [RightCosetEquivalence, rightCoset_eq_iff]
  

Proof state:
G : Type u_1
inst✝ : Group G
H K : Subgroup G
S T : Set G
hST : IsComplement S T
hHT : IsComplement (↑H) T
hSK : IsComplement S ↑K
g₁ g₂ : G
⊢ ((equiv hHT) g₁).2 = ((equiv hHT) g₂).2 ↔ g₂ * g₁⁻¹ ∈ H

Next tactic:
constructor