-- Mathlib/GroupTheory/CosetCover.lean
theorem exists_finiteIndex_of_leftCoset_cover_aux [DecidableEq (Subgroup G)]
    (j : ι) (hj : j ∈ s) (hcovers' : ⋃ i ∈ s.filter (H · = H j), g i • (H i : Set G) ≠ Set.univ) :
    ∃ i ∈ s, H i ≠ H j ∧ (H i).FiniteIndex

Proof state:
case refine_2
G : Type u_1
inst✝¹ : Group G
inst✝ : DecidableEq (Subgroup G)
n : ℕ
ih :
  ∀ m < n,
    ∀ {ι : Type u_2} {H : ι → Subgroup G} {g : ι → G} {s : Finset ι},
      ⋃ i ∈ s, g i • ↑(H i) = Set.univ →
        ∀ j ∈ s,
          ⋃ i ∈ Finset.filter (fun x => H x = H j) s, g i • ↑(H i) ≠ Set.univ →
            m = (Finset.image H s).card → ∃ i ∈ s, H i ≠ H j ∧ (H i).FiniteIndex
ι : Type u_2
H : ι → Subgroup G
g : ι → G
s : Finset ι
hcovers : ⋃ i ∈ s, g i • ↑(H i) = Set.univ
j : ι
hj : j ∈ s
hcovers' : ⋃ i ∈ Finset.filter (fun x => H x = H j) s, g i • ↑(H i) ≠ Set.univ
hn : n = (Finset.image H s).card
x : G
hx : ∀ i ∈ s, H i = H j → ↑(g i) ≠ ↑x
y z : G
hz : z ∈ y • ↑(H j)
i : ι
hi : i ∈ s
hmem : ↑(g i) = ↑(x * (y⁻¹ * z))
⊢ z ∈ (y * x⁻¹ * g i) • ↑(H i)

Tactic:
simpa [mem_leftCoset_iff, SetLike.mem_coe, QuotientGroup.eq, mul_assoc] using hmem

Result:
no goals

Proof state:
case ind
G : Type u_1
inst✝¹ : Group G
inst✝ : DecidableEq (Subgroup G)
n : ℕ
ih :
  ∀ m < n,
    ∀ {ι : Type u_2} {H : ι → Subgroup G} {g : ι → G} {s : Finset ι},
      ⋃ i ∈ s, g i • ↑(H i) = Set.univ →
        ∀ j ∈ s,
          ⋃ i ∈ Finset.filter (fun x => H x = H j) s, g i • ↑(H i) ≠ Set.univ →
            m = (Finset.image H s).card → ∃ i ∈ s, H i ≠ H j ∧ (H i).FiniteIndex
ι : Type u_2
H : ι → Subgroup G
g : ι → G
s : Finset ι
hcovers : ⋃ i ∈ s, g i • ↑(H i) = Set.univ
j : ι
hj : j ∈ s
hcovers' : ⋃ i ∈ Finset.filter (fun x => H x = H j) s, g i • ↑(H i) ≠ Set.univ
hn : n = (Finset.image H s).card
x : G
hx : ∀ (y : G), y • ↑(H j) ⊆ ⋃ i ∈ Finset.filter (fun x => H x ≠ H j) s, (y * x⁻¹ * g i) • ↑(H i)
κ : Type u_2 :=
  { x // x ∈ Finset.filter (fun x => H x ≠ H j) s } × Option { x // x ∈ Finset.filter (fun x => H x = H j) s }
⊢ ∃ i ∈ s, H i ≠ H j ∧ (H i).FiniteIndex

Tactic:
let f : κ → G
| ⟨k₁, some k₂⟩ => g k₂ * x⁻¹ * g k₁
| ⟨k₁, none⟩ => g k₁

Result:
case ind
G : Type u_1
inst✝¹ : Group G
inst✝ : DecidableEq (Subgroup G)
n : ℕ
ih :
  ∀ m < n,
    ∀ {ι : Type u_2} {H : ι → Subgroup G} {g : ι → G} {s : Finset ι},
      ⋃ i ∈ s, g i • ↑(H i) = Set.univ →
        ∀ j ∈ s,
          ⋃ i ∈ Finset.filter (fun x => H x = H j) s, g i • ↑(H i) ≠ Set.univ →
            m = (Finset.image H s).card → ∃ i ∈ s, H i ≠ H j ∧ (H i).FiniteIndex
ι : Type u_2
H : ι → Subgroup G
g : ι → G
s : Finset ι
hcovers : ⋃ i ∈ s, g i • ↑(H i) = Set.univ
j : ι
hj : j ∈ s
hcovers' : ⋃ i ∈ Finset.filter (fun x => H x = H j) s, g i • ↑(H i) ≠ Set.univ
hn : n = (Finset.image H s).card
x : G
hx : ∀ (y : G), y • ↑(H j) ⊆ ⋃ i ∈ Finset.filter (fun x => H x ≠ H j) s, (y * x⁻¹ * g i) • ↑(H i)
κ : Type u_2 :=
  { x // x ∈ Finset.filter (fun x => H x ≠ H j) s } × Option { x // x ∈ Finset.filter (fun x => H x = H j) s }
f : κ → G :=
  fun x_1 =>
    match x_1 with
    | (k₁, some k₂) => g ↑k₂ * x⁻¹ * g ↑k₁
    | (k₁, none) => g ↑k₁
⊢ ∃ i ∈ s, H i ≠ H j ∧ (H i).FiniteIndex

Proof state:
G : Type u_1
inst✝¹ : Group G
inst✝ : DecidableEq (Subgroup G)
n : ℕ
ih :
  ∀ m < n,
    ∀ {ι : Type u_2} {H : ι → Subgroup G} {g : ι → G} {s : Finset ι},
      ⋃ i ∈ s, g i • ↑(H i) = Set.univ →
        ∀ j ∈ s,
          ⋃ i ∈ Finset.filter (fun x => H x = H j) s, g i • ↑(H i) ≠ Set.univ →
            m = (Finset.image H s).card → ∃ i ∈ s, H i ≠ H j ∧ (H i).FiniteIndex
ι : Type u_2
H : ι → Subgroup G
g : ι → G
s : Finset ι
j : ι
hcovers :
  (⋃ x ∈ Finset.filter (fun x => H x = H j) s, g x • ↑(H x)) ∪
      ⋃ x ∈ Finset.filter (fun a => ¬H a = H j) s, g x • ↑(H x) =
    Set.univ
hj : j ∈ s
hcovers' : ⋃ i ∈ Finset.filter (fun x => H x = H j) s, g i • ↑(H i) ≠ Set.univ
hn : n = (Finset.image H s).card
x : G
hx : ∀ (y : G), y • ↑(H j) ⊆ ⋃ i ∈ Finset.filter (fun x => H x ≠ H j) s, (y * x⁻¹ * g i) • ↑(H i)
κ : Type u_2 :=
  { x // x ∈ Finset.filter (fun x => H x ≠ H j) s } × Option { x // x ∈ Finset.filter (fun x => H x = H j) s }
f : κ → G :=
  fun x_1 =>
    match x_1 with
    | (k₁, some k₂) => g ↑k₂ * x⁻¹ * g ↑k₁
    | (k₁, none) => g ↑k₁
K : κ → Subgroup G := fun k => H ↑k.1
hK' : ∀ (k : κ), K k ∈ (Finset.image H s).erase (H j)
hK : ∀ (k : κ), K k ≠ H j
y : G
hy✝ : y ∈ ⋃ x ∈ Finset.filter (fun x => H x = H j) s, g x • ↑(H x)
k : ι
hk : k ∈ Finset.filter (fun x => H x = H j) s
hy : y ∈ g k • ↑(H k)
⊢ ?m.91606 ∧ H k = H j

Tactic:
simpa using hk

Result:
no goals

Proof state:
G : Type u_1
inst✝¹ : Group G
inst✝ : DecidableEq (Subgroup G)
n : ℕ
ih :
  ∀ m < n,
    ∀ {ι : Type u_2} {H : ι → Subgroup G} {g : ι → G} {s : Finset ι},
      ⋃ i ∈ s, g i • ↑(H i) = Set.univ →
        ∀ j ∈ s,
          ⋃ i ∈ Finset.filter (fun x => H x = H j) s, g i • ↑(H i) ≠ Set.univ →
            m = (Finset.image H s).card → ∃ i ∈ s, H i ≠ H j ∧ (H i).FiniteIndex
ι : Type u_2
H : ι → Subgroup G
g : ι → G
s : Finset ι
hcovers : ⋃ i ∈ s, g i • ↑(H i) = Set.univ
j : ι
hj : j ∈ s
hcovers' : ⋃ i ∈ Finset.filter (fun x => H x = H j) s, g i • ↑(H i) ≠ Set.univ
hn : n = (Finset.image H s).card
x : G
hx : ∀ (y : G), y • ↑(H j) ⊆ ⋃ i ∈ Finset.filter (fun x => H x ≠ H j) s, (y * x⁻¹ * g i) • ↑(H i)
κ : Type u_2 :=
  { x // x ∈ Finset.filter (fun x => H x ≠ H j) s } × Option { x // x ∈ Finset.filter (fun x => H x = H j) s }
f : κ → G :=
  fun x_1 =>
    match x_1 with
    | (k₁, some k₂) => g ↑k₂ * x⁻¹ * g ↑k₁
    | (k₁, none) => g ↑k₁
K : κ → Subgroup G := fun k => H ↑k.1
k : κ
⊢ K k ∈ (Finset.image H s).erase (H j)

Tactic:
have := Finset.mem_filter.mp k.1.property

Result:
G : Type u_1
inst✝¹ : Group G
inst✝ : DecidableEq (Subgroup G)
n : ℕ
ih :
  ∀ m < n,
    ∀ {ι : Type u_2} {H : ι → Subgroup G} {g : ι → G} {s : Finset ι},
      ⋃ i ∈ s, g i • ↑(H i) = Set.univ →
        ∀ j ∈ s,
          ⋃ i ∈ Finset.filter (fun x => H x = H j) s, g i • ↑(H i) ≠ Set.univ →
            m = (Finset.image H s).card → ∃ i ∈ s, H i ≠ H j ∧ (H i).FiniteIndex
ι : Type u_2
H : ι → Subgroup G
g : ι → G
s : Finset ι
hcovers : ⋃ i ∈ s, g i • ↑(H i) = Set.univ
j : ι
hj : j ∈ s
hcovers' : ⋃ i ∈ Finset.filter (fun x => H x = H j) s, g i • ↑(H i) ≠ Set.univ
hn : n = (Finset.image H s).card
x : G
hx : ∀ (y : G), y • ↑(H j) ⊆ ⋃ i ∈ Finset.filter (fun x => H x ≠ H j) s, (y * x⁻¹ * g i) • ↑(H i)
κ : Type u_2 :=
  { x // x ∈ Finset.filter (fun x => H x ≠ H j) s } × Option { x // x ∈ Finset.filter (fun x => H x = H j) s }
f : κ → G :=
  fun x_1 =>
    match x_1 with
    | (k₁, some k₂) => g ↑k₂ * x⁻¹ * g ↑k₁
    | (k₁, none) => g ↑k₁
K : κ → Subgroup G := fun k => H ↑k.1
k : κ
this : ↑k.1 ∈ s ∧ H ↑k.1 ≠ H j
⊢ K k ∈ (Finset.image H s).erase (H j)