Theorem: Subgroup.exists_finset_card_le_mul
File: Mathlib/GroupTheory/Schreier.lean

tactic: letI := H.fintypeQuotientOfFiniteIndex
state_before: G : Type u_1
inst✝¹ : Group G
H : Subgroup G
R S✝ : Set G
inst✝ : FiniteIndex H
S : Finset G
hS : closure ↑S = ⊤
⊢ ∃ T, Finset.card T ≤ index H * Finset.card S ∧ closure ↑T = ⊤

tactic: haveI : DecidableEq G := Classical.decEq G
state_before: G : Type u_1
inst✝¹ : Group G
H : Subgroup G
R S✝ : Set G
inst✝ : FiniteIndex H
S : Finset G
hS : closure ↑S = ⊤
this : Fintype (G ⧸ H) := fintypeQuotientOfFiniteIndex H
⊢ ∃ T, Finset.card T ≤ index H * Finset.card S ∧ closure ↑T = ⊤

tactic: obtain ⟨R₀, hR : R₀ ∈ rightTransversals (H : Set G), hR1⟩ := exists_right_transversal (1 : G)
state_before: G : Type u_1
inst✝¹ : Group G
H : Subgroup G
R S✝ : Set G
inst✝ : FiniteIndex H
S : Finset G
hS : closure ↑S = ⊤
this✝ : Fintype (G ⧸ H) := fintypeQuotientOfFiniteIndex H
this : DecidableEq G
⊢ ∃ T, Finset.card T ≤ index H * Finset.card S ∧ closure ↑T = ⊤

tactic: haveI : Fintype R₀ := Fintype.ofEquiv _ (toEquiv hR)
state_before: case intro.intro
G : Type u_1
inst✝¹ : Group G
H : Subgroup G
R S✝ : Set G
inst✝ : FiniteIndex H
S : Finset G
hS : closure ↑S = ⊤
this✝ : Fintype (G ⧸ H) := fintypeQuotientOfFiniteIndex H
this : DecidableEq G
R₀ : Set G
hR : R₀ ∈ rightTransversals ↑H
hR1 : 1 ∈ R₀
⊢ ∃ T, Finset.card T ≤ index H * Finset.card S ∧ closure ↑T = ⊤

tactic: let R : Finset G := Set.toFinset R₀
state_before: case intro.intro
G : Type u_1
inst✝¹ : Group G
H : Subgroup G
R S✝ : Set G
inst✝ : FiniteIndex H
S : Finset G
hS : closure ↑S = ⊤
this✝¹ : Fintype (G ⧸ H) := fintypeQuotientOfFiniteIndex H
this✝ : DecidableEq G
R₀ : Set G
hR : R₀ ∈ rightTransversals ↑H
hR1 : 1 ∈ R₀
this : Fintype ↑R₀
⊢ ∃ T, Finset.card T ≤ index H * Finset.card S ∧ closure ↑T = ⊤

tactic: replace hR : (R : Set G) ∈ rightTransversals (H : Set G) := by rwa [Set.coe_toFinset]
state_before: case intro.intro
G : Type u_1
inst✝¹ : Group G
H : Subgroup G
R✝ S✝ : Set G
inst✝ : FiniteIndex H
S : Finset G
hS : closure ↑S = ⊤
this✝¹ : Fintype (G ⧸ H) := fintypeQuotientOfFiniteIndex H
this✝ : DecidableEq G
R₀ : Set G
hR : R₀ ∈ rightTransversals ↑H
hR1 : 1 ∈ R₀
this : Fintype ↑R₀
R : Finset G := Set.toFinset R₀
⊢ ∃ T, Finset.card T ≤ index H * Finset.card S ∧ closure ↑T = ⊤

tactic: replace hR1 : (1 : G) ∈ R := by rwa [Set.mem_toFinset]
state_before: case intro.intro
G : Type u_1
inst✝¹ : Group G
H : Subgroup G
R✝ S✝ : Set G
inst✝ : FiniteIndex H
S : Finset G
hS : closure ↑S = ⊤
this✝¹ : Fintype (G ⧸ H) := fintypeQuotientOfFiniteIndex H
this✝ : DecidableEq G
R₀ : Set G
hR1 : 1 ∈ R₀
this : Fintype ↑R₀
R : Finset G := Set.toFinset R₀
hR : ↑R ∈ rightTransversals ↑H
⊢ ∃ T, Finset.card T ≤ index H * Finset.card S ∧ closure ↑T = ⊤

tactic: refine' ⟨_, _, closure_mul_image_eq_top' hR hR1 hS⟩
state_before: case intro.intro
G : Type u_1
inst✝¹ : Group G
H : Subgroup G
R✝ S✝ : Set G
inst✝ : FiniteIndex H
S : Finset G
hS : closure ↑S = ⊤
this✝¹ : Fintype (G ⧸ H) := fintypeQuotientOfFiniteIndex H
this✝ : DecidableEq G
R₀ : Set G
this : Fintype ↑R₀
R : Finset G := Set.toFinset R₀
hR : ↑R ∈ rightTransversals ↑H
hR1 : 1 ∈ R
⊢ ∃ T, Finset.card T ≤ index H * Finset.card S ∧ closure ↑T = ⊤

tactic: calc
  R.card = Fintype.card R := (Fintype.card_coe R).symm
  _ = _ := (Fintype.card_congr (toEquiv hR)).symm
  _ = Fintype.card (G ⧸ H) := (QuotientGroup.card_quotient_rightRel H)
  _ = H.index := H.index_eq_card.symm
state_before: case intro.intro
G : Type u_1
inst✝¹ : Group G
H : Subgroup G
R✝ S✝ : Set G
inst✝ : FiniteIndex H
S : Finset G
hS : closure ↑S = ⊤
this✝¹ : Fintype (G ⧸ H) := fintypeQuotientOfFiniteIndex H
this✝ : DecidableEq G
R₀ : Set G
this : Fintype ↑R₀
R : Finset G := Set.toFinset R₀
hR : ↑R ∈ rightTransversals ↑H
hR1 : 1 ∈ R
⊢ Finset.card R = index H

tactic: rwa [Set.coe_toFinset]
state_before: G : Type u_1
inst✝¹ : Group G
H : Subgroup G
R✝ S✝ : Set G
inst✝ : FiniteIndex H
S : Finset G
hS : closure ↑S = ⊤
this✝¹ : Fintype (G ⧸ H) := fintypeQuotientOfFiniteIndex H
this✝ : DecidableEq G
R₀ : Set G
hR : R₀ ∈ rightTransversals ↑H
hR1 : 1 ∈ R₀
this : Fintype ↑R₀
R : Finset G := Set.toFinset R₀
⊢ ↑R ∈ rightTransversals ↑H

tactic: rwa [Set.mem_toFinset]
state_before: G : Type u_1
inst✝¹ : Group G
H : Subgroup G
R✝ S✝ : Set G
inst✝ : FiniteIndex H
S : Finset G
hS : closure ↑S = ⊤
this✝¹ : Fintype (G ⧸ H) := fintypeQuotientOfFiniteIndex H
this✝ : DecidableEq G
R₀ : Set G
hR1 : 1 ∈ R₀
this : Fintype ↑R₀
R : Finset G := Set.toFinset R₀
hR : ↑R ∈ rightTransversals ↑H
⊢ 1 ∈ R