-- Mathlib/MeasureTheory/Measure/Haar/Basic.lean
theorem index_union_eq (K₁ K₂ : Compacts G) {V : Set G} (hV : (interior V).Nonempty)
    (h : Disjoint (K₁.1 * V⁻¹) (K₂.1 * V⁻¹)) :
    index (K₁.1 ∪ K₂.1) V = index K₁.1 V + index K₂.1 V

Proof state:
G : Type u_1
inst✝² : Group G
inst✝¹ : TopologicalSpace G
inst✝ : IsTopologicalGroup G
K₁ K₂ : Compacts G
V : Set G
hV : (interior V).Nonempty
h : Disjoint (K₁.carrier * V⁻¹) (K₂.carrier * V⁻¹)
⊢ index K₁.carrier V + index K₂.carrier V ≤ index (K₁.carrier ∪ K₂.carrier) V

Tactic:
rcases index_elim (K₁.2.union K₂.2) hV with ⟨s, h1s, h2s⟩

Result:
case intro.intro
G : Type u_1
inst✝² : Group G
inst✝¹ : TopologicalSpace G
inst✝ : IsTopologicalGroup G
K₁ K₂ : Compacts G
V : Set G
hV : (interior V).Nonempty
h : Disjoint (K₁.carrier * V⁻¹) (K₂.carrier * V⁻¹)
s : Finset G
h1s : K₁.carrier ∪ K₂.carrier ⊆ ⋃ g ∈ s, (fun h => g * h) ⁻¹' V
h2s : s.card = index (K₁.carrier ∪ K₂.carrier) V
⊢ index K₁.carrier V + index K₂.carrier V ≤ index (K₁.carrier ∪ K₂.carrier) V

Proof state:
case intro.intro
G : Type u_1
inst✝² : Group G
inst✝¹ : TopologicalSpace G
inst✝ : IsTopologicalGroup G
K₁ K₂ : Compacts G
V : Set G
hV : (interior V).Nonempty
h : Disjoint (K₁.carrier * V⁻¹) (K₂.carrier * V⁻¹)
s : Finset G
h1s : K₁.carrier ∪ K₂.carrier ⊆ ⋃ g ∈ s, (fun h => g * h) ⁻¹' V
h2s : s.card = index (K₁.carrier ∪ K₂.carrier) V
⊢ index K₁.carrier V + index K₂.carrier V ≤ index (K₁.carrier ∪ K₂.carrier) V

Tactic:
rw [← h2s]

Result:
case intro.intro
G : Type u_1
inst✝² : Group G
inst✝¹ : TopologicalSpace G
inst✝ : IsTopologicalGroup G
K₁ K₂ : Compacts G
V : Set G
hV : (interior V).Nonempty
h : Disjoint (K₁.carrier * V⁻¹) (K₂.carrier * V⁻¹)
s : Finset G
h1s : K₁.carrier ∪ K₂.carrier ⊆ ⋃ g ∈ s, (fun h => g * h) ⁻¹' V
h2s : s.card = index (K₁.carrier ∪ K₂.carrier) V
⊢ index K₁.carrier V + index K₂.carrier V ≤ s.card

Proof state:
G : Type u_1
inst✝² : Group G
inst✝¹ : TopologicalSpace G
inst✝ : IsTopologicalGroup G
K₁ K₂ : Compacts G
V : Set G
hV : (interior V).Nonempty
h : Disjoint (K₁.carrier * V⁻¹) (K₂.carrier * V⁻¹)
⊢ index (K₁.carrier ∪ K₂.carrier) V = index K₁.carrier V + index K₂.carrier V

Tactic:
apply le_antisymm (index_union_le K₁ K₂ hV)

Result:
G : Type u_1
inst✝² : Group G
inst✝¹ : TopologicalSpace G
inst✝ : IsTopologicalGroup G
K₁ K₂ : Compacts G
V : Set G
hV : (interior V).Nonempty
h : Disjoint (K₁.carrier * V⁻¹) (K₂.carrier * V⁻¹)
⊢ index K₁.carrier V + index K₂.carrier V ≤ index (K₁.carrier ∪ K₂.carrier) V

Proof state:
case hm
G : Type u_1
inst✝² : Group G
inst✝¹ : TopologicalSpace G
inst✝ : IsTopologicalGroup G
K₁ K₂ : Compacts G
V : Set G
hV : (interior V).Nonempty
h : Disjoint (K₁.carrier * V⁻¹) (K₂.carrier * V⁻¹)
s : Finset G
h1s : K₁.carrier ∪ K₂.carrier ⊆ ⋃ g ∈ s, (fun h => g * h) ⁻¹' V
h2s : s.card = index (K₁.carrier ∪ K₂.carrier) V
K : Set G
hK : K ⊆ ⋃ g ∈ s, (fun h => g * h) ⁻¹' V
⊢ (Finset.filter (fun g => ((fun h => g * h) ⁻¹' V ∩ K).Nonempty) s).card ∈
    Finset.card '' {t | K ⊆ ⋃ g ∈ t, (fun h => g * h) ⁻¹' V}

Tactic:
refine ⟨_, ?_, rfl⟩

Result:
case hm
G : Type u_1
inst✝² : Group G
inst✝¹ : TopologicalSpace G
inst✝ : IsTopologicalGroup G
K₁ K₂ : Compacts G
V : Set G
hV : (interior V).Nonempty
h : Disjoint (K₁.carrier * V⁻¹) (K₂.carrier * V⁻¹)
s : Finset G
h1s : K₁.carrier ∪ K₂.carrier ⊆ ⋃ g ∈ s, (fun h => g * h) ⁻¹' V
h2s : s.card = index (K₁.carrier ∪ K₂.carrier) V
K : Set G
hK : K ⊆ ⋃ g ∈ s, (fun h => g * h) ⁻¹' V
⊢ Finset.filter (fun g => ((fun h => g * h) ⁻¹' V ∩ K).Nonempty) s ∈ {t | K ⊆ ⋃ g ∈ t, (fun h => g * h) ⁻¹' V}

Proof state:
case intro.intro.intro.intro.intro.intro.left.refine_2
G : Type u_1
inst✝² : Group G
inst✝¹ : TopologicalSpace G
inst✝ : IsTopologicalGroup G
K₁ K₂ : Compacts G
V : Set G
hV : (interior V).Nonempty
h : Disjoint (K₁.carrier * V⁻¹) (K₂.carrier * V⁻¹)
s : Finset G
h1s : K₁.carrier ∪ K₂.carrier ⊆ ⋃ g ∈ s, (fun h => g * h) ⁻¹' V
h2s : s.card = index (K₁.carrier ∪ K₂.carrier) V
this :
  ∀ K ⊆ ⋃ g ∈ s, (fun h => g * h) ⁻¹' V,
    index K V ≤ (Finset.filter (fun g => ((fun h => g * h) ⁻¹' V ∩ K).Nonempty) s).card
g₁ : G
a✝ : g₁ ∈ s
g₂ : G
h2g₂ : g₂ ∈ K₁.carrier
g₃ : G
h2g₃ : g₃ ∈ K₂.carrier
h1g₃ : g₁ * g₃ ∈ V
h1g₂ : g₁ * g₂ ∈ V
⊢ g₂ * (g₁ * g₂)⁻¹ = g₁⁻¹

Tactic:
simp only [mul_inv_rev, mul_inv_cancel_left]

Result:
no goals

Proof state:
case intro.intro
G : Type u_1
inst✝² : Group G
inst✝¹ : TopologicalSpace G
inst✝ : IsTopologicalGroup G
K₁ K₂ : Compacts G
V : Set G
hV : (interior V).Nonempty
h : Disjoint (K₁.carrier * V⁻¹) (K₂.carrier * V⁻¹)
s : Finset G
h1s : K₁.carrier ∪ K₂.carrier ⊆ ⋃ g ∈ s, (fun h => g * h) ⁻¹' V
h2s : s.card = index (K₁.carrier ∪ K₂.carrier) V
this :
  ∀ K ⊆ ⋃ g ∈ s, (fun h => g * h) ⁻¹' V,
    index K V ≤ (Finset.filter (fun g => ((fun h => g * h) ⁻¹' V ∩ K).Nonempty) s).card
⊢ (Finset.filter
        (fun x => ((fun h => x * h) ⁻¹' V ∩ K₁.carrier).Nonempty ∨ ((fun h => x * h) ⁻¹' V ∩ K₂.carrier).Nonempty)
        s).card ≤
    s.card

Tactic:
exact s.card_filter_le _

Result:
no goals

Proof state:
case intro.intro
G : Type u_1
inst✝² : Group G
inst✝¹ : TopologicalSpace G
inst✝ : IsTopologicalGroup G
K₁ K₂ : Compacts G
V : Set G
hV : (interior V).Nonempty
h : Disjoint (K₁.carrier * V⁻¹) (K₂.carrier * V⁻¹)
s : Finset G
h1s : K₁.carrier ∪ K₂.carrier ⊆ ⋃ g ∈ s, (fun h => g * h) ⁻¹' V
h2s : s.card = index (K₁.carrier ∪ K₂.carrier) V
this :
  ∀ K ⊆ ⋃ g ∈ s, (fun h => g * h) ⁻¹' V,
    index K V ≤ (Finset.filter (fun g => ((fun h => g * h) ⁻¹' V ∩ K).Nonempty) s).card
⊢ (Finset.filter (fun g => ((fun h => g * h) ⁻¹' V ∩ K₁.carrier).Nonempty) s).card +
      (Finset.filter (fun g => ((fun h => g * h) ⁻¹' V ∩ K₂.carrier).Nonempty) s).card ≤
    s.card

Tactic:
rw [← Finset.card_union_of_disjoint, Finset.filter_union_right]

Result:
case intro.intro
G : Type u_1
inst✝² : Group G
inst✝¹ : TopologicalSpace G
inst✝ : IsTopologicalGroup G
K₁ K₂ : Compacts G
V : Set G
hV : (interior V).Nonempty
h : Disjoint (K₁.carrier * V⁻¹) (K₂.carrier * V⁻¹)
s : Finset G
h1s : K₁.carrier ∪ K₂.carrier ⊆ ⋃ g ∈ s, (fun h => g * h) ⁻¹' V
h2s : s.card = index (K₁.carrier ∪ K₂.carrier) V
this :
  ∀ K ⊆ ⋃ g ∈ s, (fun h => g * h) ⁻¹' V,
    index K V ≤ (Finset.filter (fun g => ((fun h => g * h) ⁻¹' V ∩ K).Nonempty) s).card
⊢ (Finset.filter
        (fun x => ((fun h => x * h) ⁻¹' V ∩ K₁.carrier).Nonempty ∨ ((fun h => x * h) ⁻¹' V ∩ K₂.carrier).Nonempty)
        s).card ≤
    s.card

case intro.intro
G : Type u_1
inst✝² : Group G
inst✝¹ : TopologicalSpace G
inst✝ : IsTopologicalGroup G
K₁ K₂ : Compacts G
V : Set G
hV : (interior V).Nonempty
h : Disjoint (K₁.carrier * V⁻¹) (K₂.carrier * V⁻¹)
s : Finset G
h1s : K₁.carrier ∪ K₂.carrier ⊆ ⋃ g ∈ s, (fun h => g * h) ⁻¹' V
h2s : s.card = index (K₁.carrier ∪ K₂.carrier) V
this :
  ∀ K ⊆ ⋃ g ∈ s, (fun h => g * h) ⁻¹' V,
    index K V ≤ (Finset.filter (fun g => ((fun h => g * h) ⁻¹' V ∩ K).Nonempty) s).card
⊢ Disjoint (Finset.filter (fun g => ((fun h => g * h) ⁻¹' V ∩ K₁.carrier).Nonempty) s)
    (Finset.filter (fun g => ((fun h => g * h) ⁻¹' V ∩ K₂.carrier).Nonempty) s)