l3lab/ntp-mathlib huggingface dataset:
@[to_additive addIndex_union_eq]
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 := by
  apply le_antisymm (index_union_le K₁ K₂ hV)
  rcases index_elim (K₁.2.union K₂.2) hV with ⟨s, h1s, h2s⟩; rw [← h2s]
  have :
    ∀ K : Set G,
      (K ⊆ ⋃ g ∈ s, (fun h => g * h) ⁻¹' V) →
        index K V ≤ (s.filter fun g => ((fun h : G => g * h) ⁻¹' V ∩ K).Nonempty).card := by
    intro K hK; apply Nat.sInf_le; refine' ⟨_, _, rfl⟩; rw [mem_setOf_eq]
    intro g hg; rcases hK hg with ⟨_, ⟨g₀, rfl⟩, _, ⟨h1g₀, rfl⟩, h2g₀⟩
    simp only [mem_preimage] at h2g₀
    simp only [mem_iUnion]; use g₀; constructor; swap
    · simp only [Finset.mem_filter, h1g₀, true_and_iff]; use g
      simp only [hg, h2g₀, mem_inter_iff, mem_preimage, and_self_iff]
    exact h2g₀
  refine'
    le_trans
      (add_le_add (this K₁.1 <| Subset.trans (subset_union_left _ _) h1s)
        (this K₂.1 <| Subset.trans (subset_union_right _ _) h1s)) _
  rw [← Finset.card_union_eq, Finset.filter_union_right]
  exact s.card_filter_le _
  apply Finset.disjoint_filter.mpr
  rintro g₁ _ ⟨g₂, h1g₂, h2g₂⟩ ⟨g₃, h1g₃, h2g₃⟩
  simp only [mem_preimage] at h1g₃ h1g₂
  refine' h.le_bot (_ : g₁⁻¹ ∈ _)
  constructor <;> simp only [Set.mem_inv, Set.mem_mul, exists_exists_and_eq_and, exists_and_left]
  · refine' ⟨_, h2g₂, (g₁ * g₂)⁻¹, _, _⟩; simp only [inv_inv, h1g₂]
    simp only [mul_inv_rev, mul_inv_cancel_left]
  · refine' ⟨_, h2g₃, (g₁ * g₃)⁻¹, _, _⟩; 

Proof state:
case intro.intro.intro.intro.intro.intro.right.refine'_1
G : Type u_1
inst✝² : Group G
inst✝¹ : TopologicalSpace G
inst✝ : TopologicalGroup G
K₁ K₂ : Compacts G
V : Set G
hV : Set.Nonempty (interior V)
h : Disjoint (K₁.carrier * V⁻¹) (K₂.carrier * V⁻¹)
s : Finset G
h1s : K₁.carrier ∪ K₂.carrier ⊆ ⋃ g ∈ s, (fun h => g * h) ⁻¹' V
h2s : Finset.card s = index (K₁.carrier ∪ K₂.carrier) V
this :
  ∀ K ⊆ ⋃ g ∈ s, (fun h => g * h) ⁻¹' V,
    index K V ≤ Finset.card (Finset.filter (fun g => Set.Nonempty ((fun h => g * h) ⁻¹' V ∩ K)) s)
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₃)⁻¹⁻¹ ∈ V
case intro.intro.intro.intro.intro.intro.right.refine'_2
G : Type u_1
inst✝² : Group G
inst✝¹ : TopologicalSpace G
inst✝ : TopologicalGroup G
K₁ K₂ : Compacts G
V : Set G
hV : Set.Nonempty (interior V)
h : Disjoint (K₁.carrier * V⁻¹) (K₂.carrier * V⁻¹)
s : Finset G
h1s : K₁.carrier ∪ K₂.carrier ⊆ ⋃ g ∈ s, (fun h => g * h) ⁻¹' V
h2s : Finset.card s = index (K₁.carrier ∪ K₂.carrier) V
this :
  ∀ K ⊆ ⋃ g ∈ s, (fun h => g * h) ⁻¹' V,
    index K V ≤ Finset.card (Finset.filter (fun g => Set.Nonempty ((fun h => g * h) ⁻¹' V ∩ K)) s)
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₁⁻¹

Next tactic:
simp only [inv_inv, h1g₃]
@[to_additive addIndex_union_eq]
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 := by
  apply le_antisymm (index_union_le K₁ K₂ hV)
  rcases index_elim (K₁.2.union K₂.2) hV with ⟨s, h1s, h2s⟩; rw [← h2s]
  have :
    ∀ K : Set G,
      (K ⊆ ⋃ g ∈ s, (fun h => g * h) ⁻¹' V) →
        index K V ≤ (s.filter fun g => ((fun h : G => g * h) ⁻¹' V ∩ K).Nonempty).card := by
    intro K hK; apply Nat.sInf_le; refine' ⟨_, _, rfl⟩; rw [mem_setOf_eq]
    intro g hg; rcases hK hg with ⟨_, ⟨g₀, rfl⟩, _, ⟨h1g₀, rfl⟩, h2g₀⟩
    simp only [mem_preimage] at h2g₀
    simp only [mem_iUnion]; use g₀; constructor; swap
    · simp only [Finset.mem_filter, h1g₀, true_and_iff]; use g
      simp only [hg, h2g₀, mem_inter_iff, mem_preimage, and_self_iff]
    exact h2g₀
  refine'
    le_trans
      (add_le_add (this K₁.1 <| Subset.trans (subset_union_left _ _) h1s)
        (this K₂.1 <| Subset.trans (subset_union_right _ _) h1s)) _
  rw [← Finset.card_union_eq, Finset.filter_union_right]
  exact s.card_filter_le _
  apply Finset.disjoint_filter.mpr
  rintro g₁ _ ⟨g₂, h1g₂, h2g₂⟩ ⟨g₃, h1g₃, h2g₃⟩
  simp only [mem_preimage] at h1g₃ h1g₂
  refine' h.le_bot (_ : g₁⁻¹ ∈ _)
  constructor <;> simp only [Set.mem_inv, Set.mem_mul, exists_exists_and_eq_and, exists_and_left]
  · refine' ⟨_, h2g₂, (g₁ * g₂)⁻¹, _, _⟩; simp only [inv_inv, h1g₂]
    simp only [mul_inv_rev, mul_inv_cancel_left]
  · refine' ⟨_, h2g₃, (g₁ * g₃)⁻¹, _, _⟩; simp only [inv_inv, h1g₃]
    

Proof state:
case intro.intro.intro.intro.intro.intro.right.refine'_2
G : Type u_1
inst✝² : Group G
inst✝¹ : TopologicalSpace G
inst✝ : TopologicalGroup G
K₁ K₂ : Compacts G
V : Set G
hV : Set.Nonempty (interior V)
h : Disjoint (K₁.carrier * V⁻¹) (K₂.carrier * V⁻¹)
s : Finset G
h1s : K₁.carrier ∪ K₂.carrier ⊆ ⋃ g ∈ s, (fun h => g * h) ⁻¹' V
h2s : Finset.card s = index (K₁.carrier ∪ K₂.carrier) V
this :
  ∀ K ⊆ ⋃ g ∈ s, (fun h => g * h) ⁻¹' V,
    index K V ≤ Finset.card (Finset.filter (fun g => Set.Nonempty ((fun h => g * h) ⁻¹' V ∩ K)) s)
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₁⁻¹

Next tactic:
simp only [mul_inv_rev, mul_inv_cancel_left]
@[to_additive add_left_addIndex_le]
theorem mul_left_index_le {K : Set G} (hK : IsCompact K) {V : Set G} (hV : (interior V).Nonempty)
    (g : G) : index ((fun h => g * h) '' K) V ≤ index K V := by
  

Proof state:
G : Type u_1
inst✝² : Group G
inst✝¹ : TopologicalSpace G
inst✝ : TopologicalGroup G
K : Set G
hK : IsCompact K
V : Set G
hV : Set.Nonempty (interior V)
g : G
⊢ index ((fun h => g * h) '' K) V ≤ index K V

Next tactic:
rcases index_elim hK hV with ⟨s, h1s, h2s⟩
@[to_additive add_left_addIndex_le]
theorem mul_left_index_le {K : Set G} (hK : IsCompact K) {V : Set G} (hV : (interior V).Nonempty)
    (g : G) : index ((fun h => g * h) '' K) V ≤ index K V := by
  rcases index_elim hK hV with ⟨s, h1s, h2s⟩; 

Proof state:
case intro.intro
G : Type u_1
inst✝² : Group G
inst✝¹ : TopologicalSpace G
inst✝ : TopologicalGroup G
K : Set G
hK : IsCompact K
V : Set G
hV : Set.Nonempty (interior V)
g : G
s : Finset G
h1s : K ⊆ ⋃ g ∈ s, (fun h => g * h) ⁻¹' V
h2s : Finset.card s = index K V
⊢ index ((fun h => g * h) '' K) V ≤ index K V

Next tactic:
rw [← h2s]
@[to_additive add_left_addIndex_le]
theorem mul_left_index_le {K : Set G} (hK : IsCompact K) {V : Set G} (hV : (interior V).Nonempty)
    (g : G) : index ((fun h => g * h) '' K) V ≤ index K V := by
  rcases index_elim hK hV with ⟨s, h1s, h2s⟩; rw [← h2s]
  

Proof state:
case intro.intro
G : Type u_1
inst✝² : Group G
inst✝¹ : TopologicalSpace G
inst✝ : TopologicalGroup G
K : Set G
hK : IsCompact K
V : Set G
hV : Set.Nonempty (interior V)
g : G
s : Finset G
h1s : K ⊆ ⋃ g ∈ s, (fun h => g * h) ⁻¹' V
h2s : Finset.card s = index K V
⊢ index ((fun h => g * h) '' K) V ≤ Finset.card s

Next tactic:
apply Nat.sInf_le
@[to_additive add_left_addIndex_le]
theorem mul_left_index_le {K : Set G} (hK : IsCompact K) {V : Set G} (hV : (interior V).Nonempty)
    (g : G) : index ((fun h => g * h) '' K) V ≤ index K V := by
  rcases index_elim hK hV with ⟨s, h1s, h2s⟩; rw [← h2s]
  apply Nat.sInf_le; 

Proof state:
case intro.intro.hm
G : Type u_1
inst✝² : Group G
inst✝¹ : TopologicalSpace G
inst✝ : TopologicalGroup G
K : Set G
hK : IsCompact K
V : Set G
hV : Set.Nonempty (interior V)
g : G
s : Finset G
h1s : K ⊆ ⋃ g ∈ s, (fun h => g * h) ⁻¹' V
h2s : Finset.card s = index K V
⊢ Finset.card s ∈ Finset.card '' {t | (fun h => g * h) '' K ⊆ ⋃ g ∈ t, (fun h => g * h) ⁻¹' V}

Next tactic:
rw [mem_image]
@[to_additive add_left_addIndex_le]
theorem mul_left_index_le {K : Set G} (hK : IsCompact K) {V : Set G} (hV : (interior V).Nonempty)
    (g : G) : index ((fun h => g * h) '' K) V ≤ index K V := by
  rcases index_elim hK hV with ⟨s, h1s, h2s⟩; rw [← h2s]
  apply Nat.sInf_le; rw [mem_image]
  

Proof state:
case intro.intro.hm
G : Type u_1
inst✝² : Group G
inst✝¹ : TopologicalSpace G
inst✝ : TopologicalGroup G
K : Set G
hK : IsCompact K
V : Set G
hV : Set.Nonempty (interior V)
g : G
s : Finset G
h1s : K ⊆ ⋃ g ∈ s, (fun h => g * h) ⁻¹' V
h2s : Finset.card s = index K V
⊢ ∃ x ∈ {t | (fun h => g * h) '' K ⊆ ⋃ g ∈ t, (fun h => g * h) ⁻¹' V}, Finset.card x = Finset.card s

Next tactic:
refine' ⟨s.map (Equiv.mulRight g⁻¹).toEmbedding, _, Finset.card_map _⟩
@[to_additive add_left_addIndex_le]
theorem mul_left_index_le {K : Set G} (hK : IsCompact K) {V : Set G} (hV : (interior V).Nonempty)
    (g : G) : index ((fun h => g * h) '' K) V ≤ index K V := by
  rcases index_elim hK hV with ⟨s, h1s, h2s⟩; rw [← h2s]
  apply Nat.sInf_le; rw [mem_image]
  refine' ⟨s.map (Equiv.mulRight g⁻¹).toEmbedding, _, Finset.card_map _⟩
  · 

Proof state:
case intro.intro.hm
G : Type u_1
inst✝² : Group G
inst✝¹ : TopologicalSpace G
inst✝ : TopologicalGroup G
K : Set G
hK : IsCompact K
V : Set G
hV : Set.Nonempty (interior V)
g : G
s : Finset G
h1s : K ⊆ ⋃ g ∈ s, (fun h => g * h) ⁻¹' V
h2s : Finset.card s = index K V
⊢ Finset.map (Equiv.toEmbedding (Equiv.mulRight g⁻¹)) s ∈ {t | (fun h => g * h) '' K ⊆ ⋃ g ∈ t, (fun h => g * h) ⁻¹' V}

Next tactic:
simp only [mem_setOf_eq]
@[to_additive add_left_addIndex_le]
theorem mul_left_index_le {K : Set G} (hK : IsCompact K) {V : Set G} (hV : (interior V).Nonempty)
    (g : G) : index ((fun h => g * h) '' K) V ≤ index K V := by
  rcases index_elim hK hV with ⟨s, h1s, h2s⟩; rw [← h2s]
  apply Nat.sInf_le; rw [mem_image]
  refine' ⟨s.map (Equiv.mulRight g⁻¹).toEmbedding, _, Finset.card_map _⟩
  · simp only [mem_setOf_eq]; 

Proof state:
case intro.intro.hm
G : Type u_1
inst✝² : Group G
inst✝¹ : TopologicalSpace G
inst✝ : TopologicalGroup G
K : Set G
hK : IsCompact K
V : Set G
hV : Set.Nonempty (interior V)
g : G
s : Finset G
h1s : K ⊆ ⋃ g ∈ s, (fun h => g * h) ⁻¹' V
h2s : Finset.card s = index K V
⊢ (fun h => g * h) '' K ⊆ ⋃ g_1 ∈ Finset.map (Equiv.toEmbedding (Equiv.mulRight g⁻¹)) s, (fun h => g_1 * h) ⁻¹' V

Next tactic:
refine' Subset.trans (image_subset _ h1s) _
@[to_additive add_left_addIndex_le]
theorem mul_left_index_le {K : Set G} (hK : IsCompact K) {V : Set G} (hV : (interior V).Nonempty)
    (g : G) : index ((fun h => g * h) '' K) V ≤ index K V := by
  rcases index_elim hK hV with ⟨s, h1s, h2s⟩; rw [← h2s]
  apply Nat.sInf_le; rw [mem_image]
  refine' ⟨s.map (Equiv.mulRight g⁻¹).toEmbedding, _, Finset.card_map _⟩
  · simp only [mem_setOf_eq]; refine' Subset.trans (image_subset _ h1s) _
    

Proof state:
case intro.intro.hm
G : Type u_1
inst✝² : Group G
inst✝¹ : TopologicalSpace G
inst✝ : TopologicalGroup G
K : Set G
hK : IsCompact K
V : Set G
hV : Set.Nonempty (interior V)
g : G
s : Finset G
h1s : K ⊆ ⋃ g ∈ s, (fun h => g * h) ⁻¹' V
h2s : Finset.card s = index K V
⊢ (fun h => g * h) '' ⋃ g ∈ s, (fun h => g * h) ⁻¹' V ⊆
    ⋃ g_1 ∈ Finset.map (Equiv.toEmbedding (Equiv.mulRight g⁻¹)) s, (fun h => g_1 * h) ⁻¹' V

Next tactic:
rintro _ ⟨g₁, ⟨_, ⟨g₂, rfl⟩, ⟨_, ⟨hg₂, rfl⟩, hg₁⟩⟩, rfl⟩
@[to_additive add_left_addIndex_le]
theorem mul_left_index_le {K : Set G} (hK : IsCompact K) {V : Set G} (hV : (interior V).Nonempty)
    (g : G) : index ((fun h => g * h) '' K) V ≤ index K V := by
  rcases index_elim hK hV with ⟨s, h1s, h2s⟩; rw [← h2s]
  apply Nat.sInf_le; rw [mem_image]
  refine' ⟨s.map (Equiv.mulRight g⁻¹).toEmbedding, _, Finset.card_map _⟩
  · simp only [mem_setOf_eq]; refine' Subset.trans (image_subset _ h1s) _
    rintro _ ⟨g₁, ⟨_, ⟨g₂, rfl⟩, ⟨_, ⟨hg₂, rfl⟩, hg₁⟩⟩, rfl⟩
    

Proof state:
case intro.intro.hm.intro.intro.intro.intro.intro.intro.intro.intro
G : Type u_1
inst✝² : Group G
inst✝¹ : TopologicalSpace G
inst✝ : TopologicalGroup G
K : Set G
hK : IsCompact K
V : Set G
hV : Set.Nonempty (interior V)
g : G
s : Finset G
h1s : K ⊆ ⋃ g ∈ s, (fun h => g * h) ⁻¹' V
h2s : Finset.card s = index K V
g₁ g₂ : G
hg₂ : g₂ ∈ s
hg₁ : g₁ ∈ (fun h => (fun h => g₂ * h) ⁻¹' V) hg₂
⊢ (fun h => g * h) g₁ ∈ ⋃ g_1 ∈ Finset.map (Equiv.toEmbedding (Equiv.mulRight g⁻¹)) s, (fun h => g_1 * h) ⁻¹' V

Next tactic:
simp only [mem_preimage] at hg₁
@[to_additive add_left_addIndex_le]
theorem mul_left_index_le {K : Set G} (hK : IsCompact K) {V : Set G} (hV : (interior V).Nonempty)
    (g : G) : index ((fun h => g * h) '' K) V ≤ index K V := by
  rcases index_elim hK hV with ⟨s, h1s, h2s⟩; rw [← h2s]
  apply Nat.sInf_le; rw [mem_image]
  refine' ⟨s.map (Equiv.mulRight g⁻¹).toEmbedding, _, Finset.card_map _⟩
  · simp only [mem_setOf_eq]; refine' Subset.trans (image_subset _ h1s) _
    rintro _ ⟨g₁, ⟨_, ⟨g₂, rfl⟩, ⟨_, ⟨hg₂, rfl⟩, hg₁⟩⟩, rfl⟩
    simp only [mem_preimage] at hg₁;
    

Proof state:
case intro.intro.hm.intro.intro.intro.intro.intro.intro.intro.intro
G : Type u_1
inst✝² : Group G
inst✝¹ : TopologicalSpace G
inst✝ : TopologicalGroup G
K : Set G
hK : IsCompact K
V : Set G
hV : Set.Nonempty (interior V)
g : G
s : Finset G
h1s : K ⊆ ⋃ g ∈ s, (fun h => g * h) ⁻¹' V
h2s : Finset.card s = index K V
g₁ g₂ : G
hg₂ : g₂ ∈ s
hg₁ : g₂ * g₁ ∈ V
⊢ (fun h => g * h) g₁ ∈ ⋃ g_1 ∈ Finset.map (Equiv.toEmbedding (Equiv.mulRight g⁻¹)) s, (fun h => g_1 * h) ⁻¹' V

Next tactic:
simp only [exists_prop, mem_iUnion, Finset.mem_map, Equiv.coe_mulRight,
      exists_exists_and_eq_and, mem_preimage, Equiv.toEmbedding_apply]
@[to_additive add_left_addIndex_le]
theorem mul_left_index_le {K : Set G} (hK : IsCompact K) {V : Set G} (hV : (interior V).Nonempty)
    (g : G) : index ((fun h => g * h) '' K) V ≤ index K V := by
  rcases index_elim hK hV with ⟨s, h1s, h2s⟩; rw [← h2s]
  apply Nat.sInf_le; rw [mem_image]
  refine' ⟨s.map (Equiv.mulRight g⁻¹).toEmbedding, _, Finset.card_map _⟩
  · simp only [mem_setOf_eq]; refine' Subset.trans (image_subset _ h1s) _
    rintro _ ⟨g₁, ⟨_, ⟨g₂, rfl⟩, ⟨_, ⟨hg₂, rfl⟩, hg₁⟩⟩, rfl⟩
    simp only [mem_preimage] at hg₁;
    simp only [exists_prop, mem_iUnion, Finset.mem_map, Equiv.coe_mulRight,
      exists_exists_and_eq_and, mem_preimage, Equiv.toEmbedding_apply]
    

Proof state:
case intro.intro.hm.intro.intro.intro.intro.intro.intro.intro.intro
G : Type u_1
inst✝² : Group G
inst✝¹ : TopologicalSpace G
inst✝ : TopologicalGroup G
K : Set G
hK : IsCompact K
V : Set G
hV : Set.Nonempty (interior V)
g : G
s : Finset G
h1s : K ⊆ ⋃ g ∈ s, (fun h => g * h) ⁻¹' V
h2s : Finset.card s = index K V
g₁ g₂ : G
hg₂ : g₂ ∈ s
hg₁ : g₂ * g₁ ∈ V
⊢ ∃ a ∈ s, a * g⁻¹ * (g * g₁) ∈ V

Next tactic:
refine' ⟨_, hg₂, _⟩
@[to_additive add_left_addIndex_le]
theorem mul_left_index_le {K : Set G} (hK : IsCompact K) {V : Set G} (hV : (interior V).Nonempty)
    (g : G) : index ((fun h => g * h) '' K) V ≤ index K V := by
  rcases index_elim hK hV with ⟨s, h1s, h2s⟩; rw [← h2s]
  apply Nat.sInf_le; rw [mem_image]
  refine' ⟨s.map (Equiv.mulRight g⁻¹).toEmbedding, _, Finset.card_map _⟩
  · simp only [mem_setOf_eq]; refine' Subset.trans (image_subset _ h1s) _
    rintro _ ⟨g₁, ⟨_, ⟨g₂, rfl⟩, ⟨_, ⟨hg₂, rfl⟩, hg₁⟩⟩, rfl⟩
    simp only [mem_preimage] at hg₁;
    simp only [exists_prop, mem_iUnion, Finset.mem_map, Equiv.coe_mulRight,
      exists_exists_and_eq_and, mem_preimage, Equiv.toEmbedding_apply]
    refine' ⟨_, hg₂, _⟩; 

Proof state:
case intro.intro.hm.intro.intro.intro.intro.intro.intro.intro.intro
G : Type u_1
inst✝² : Group G
inst✝¹ : TopologicalSpace G
inst✝ : TopologicalGroup G
K : Set G
hK : IsCompact K
V : Set G
hV : Set.Nonempty (interior V)
g : G
s : Finset G
h1s : K ⊆ ⋃ g ∈ s, (fun h => g * h) ⁻¹' V
h2s : Finset.card s = index K V
g₁ g₂ : G
hg₂ : g₂ ∈ s
hg₁ : g₂ * g₁ ∈ V
⊢ g₂ * g⁻¹ * (g * g₁) ∈ V

Next tactic:
simp only [mul_assoc, hg₁, inv_mul_cancel_left]
@[to_additive is_left_invariant_addIndex]
theorem is_left_invariant_index {K : Set G} (hK : IsCompact K) (g : G) {V : Set G}
    (hV : (interior V).Nonempty) : index ((fun h => g * h) '' K) V = index K V := by
  

Proof state:
G : Type u_1
inst✝² : Group G
inst✝¹ : TopologicalSpace G
inst✝ : TopologicalGroup G
K : Set G
hK : IsCompact K
g : G
V : Set G
hV : Set.Nonempty (interior V)
⊢ index ((fun h => g * h) '' K) V = index K V

Next tactic:
refine' le_antisymm (mul_left_index_le hK hV g) _
@[to_additive is_left_invariant_addIndex]
theorem is_left_invariant_index {K : Set G} (hK : IsCompact K) (g : G) {V : Set G}
    (hV : (interior V).Nonempty) : index ((fun h => g * h) '' K) V = index K V := by
  refine' le_antisymm (mul_left_index_le hK hV g) _
  

Proof state:
G : Type u_1
inst✝² : Group G
inst✝¹ : TopologicalSpace G
inst✝ : TopologicalGroup G
K : Set G
hK : IsCompact K
g : G
V : Set G
hV : Set.Nonempty (interior V)
⊢ index K V ≤ index ((fun h => g * h) '' K) V

Next tactic:
convert mul_left_index_le (hK.image <| continuous_mul_left g) hV g⁻¹
@[to_additive is_left_invariant_addIndex]
theorem is_left_invariant_index {K : Set G} (hK : IsCompact K) (g : G) {V : Set G}
    (hV : (interior V).Nonempty) : index ((fun h => g * h) '' K) V = index K V := by
  refine' le_antisymm (mul_left_index_le hK hV g) _
  convert mul_left_index_le (hK.image <| continuous_mul_left g) hV g⁻¹
  

Proof state:
case h.e'_3.h.e'_3
G : Type u_1
inst✝² : Group G
inst✝¹ : TopologicalSpace G
inst✝ : TopologicalGroup G
K : Set G
hK : IsCompact K
g : G
V : Set G
hV : Set.Nonempty (interior V)
⊢ K = (fun h => g⁻¹ * h) '' ((fun b => g * b) '' K)

Next tactic:
rw [image_image]
@[to_additive is_left_invariant_addIndex]
theorem is_left_invariant_index {K : Set G} (hK : IsCompact K) (g : G) {V : Set G}
    (hV : (interior V).Nonempty) : index ((fun h => g * h) '' K) V = index K V := by
  refine' le_antisymm (mul_left_index_le hK hV g) _
  convert mul_left_index_le (hK.image <| continuous_mul_left g) hV g⁻¹
  rw [image_image]; 

Proof state:
case h.e'_3.h.e'_3
G : Type u_1
inst✝² : Group G
inst✝¹ : TopologicalSpace G
inst✝ : TopologicalGroup G
K : Set G
hK : IsCompact K
g : G
V : Set G
hV : Set.Nonempty (interior V)
⊢ K = (fun x => g⁻¹ * (g * x)) '' K

Next tactic:
symm
@[to_additive is_left_invariant_addIndex]
theorem is_left_invariant_index {K : Set G} (hK : IsCompact K) (g : G) {V : Set G}
    (hV : (interior V).Nonempty) : index ((fun h => g * h) '' K) V = index K V := by
  refine' le_antisymm (mul_left_index_le hK hV g) _
  convert mul_left_index_le (hK.image <| continuous_mul_left g) hV g⁻¹
  rw [image_image]; symm; 

Proof state:
case h.e'_3.h.e'_3
G : Type u_1
inst✝² : Group G
inst✝¹ : TopologicalSpace G
inst✝ : TopologicalGroup G
K : Set G
hK : IsCompact K
g : G
V : Set G
hV : Set.Nonempty (interior V)
⊢ (fun x => g⁻¹ * (g * x)) '' K = K

Next tactic:
convert image_id' _ with h
@[to_additive is_left_invariant_addIndex]
theorem is_left_invariant_index {K : Set G} (hK : IsCompact K) (g : G) {V : Set G}
    (hV : (interior V).Nonempty) : index ((fun h => g * h) '' K) V = index K V := by
  refine' le_antisymm (mul_left_index_le hK hV g) _
  convert mul_left_index_le (hK.image <| continuous_mul_left g) hV g⁻¹
  rw [image_image]; symm; convert image_id' _ with h; 

Proof state:
case h.e'_2.h.e'_3.h
G : Type u_1
inst✝² : Group G
inst✝¹ : TopologicalSpace G
inst✝ : TopologicalGroup G
K : Set G
hK : IsCompact K
g : G
V : Set G
hV : Set.Nonempty (interior V)
h : G
⊢ g⁻¹ * (g * h) = h

Next tactic:
apply inv_mul_cancel_left
@[to_additive add_prehaar_le_addIndex]
theorem prehaar_le_index (K₀ : PositiveCompacts G) {U : Set G} (K : Compacts G)
    (hU : (interior U).Nonempty) : prehaar (K₀ : Set G) U K ≤ index (K : Set G) K₀ := by
  

Proof state:
G : Type u_1
inst✝² : Group G
inst✝¹ : TopologicalSpace G
inst✝ : TopologicalGroup G
K₀ : PositiveCompacts G
U : Set G
K : Compacts G
hU : Set.Nonempty (interior U)
⊢ prehaar (↑K₀) U K ≤ ↑(index ↑K ↑K₀)

Next tactic:
unfold prehaar
@[to_additive add_prehaar_le_addIndex]
theorem prehaar_le_index (K₀ : PositiveCompacts G) {U : Set G} (K : Compacts G)
    (hU : (interior U).Nonempty) : prehaar (K₀ : Set G) U K ≤ index (K : Set G) K₀ := by
  unfold prehaar; 

Proof state:
G : Type u_1
inst✝² : Group G
inst✝¹ : TopologicalSpace G
inst✝ : TopologicalGroup G
K₀ : PositiveCompacts G
U : Set G
K : Compacts G
hU : Set.Nonempty (interior U)
⊢ ↑(index (↑K) U) / ↑(index (↑K₀) U) ≤ ↑(index ↑K ↑K₀)

Next tactic:
rw [div_le_iff]
@[to_additive add_prehaar_le_addIndex]
theorem prehaar_le_index (K₀ : PositiveCompacts G) {U : Set G} (K : Compacts G)
    (hU : (interior U).Nonempty) : prehaar (K₀ : Set G) U K ≤ index (K : Set G) K₀ := by
  unfold prehaar; rw [div_le_iff] <;> 

Proof state:
G : Type u_1
inst✝² : Group G
inst✝¹ : TopologicalSpace G
inst✝ : TopologicalGroup G
K₀ : PositiveCompacts G
U : Set G
K : Compacts G
hU : Set.Nonempty (interior U)
⊢ ↑(index (↑K) U) ≤ ↑(index ↑K ↑K₀) * ↑(index (↑K₀) U)

Next tactic:
norm_cast
@[to_additive add_prehaar_le_addIndex]
theorem prehaar_le_index (K₀ : PositiveCompacts G) {U : Set G} (K : Compacts G)
    (hU : (interior U).Nonempty) : prehaar (K₀ : Set G) U K ≤ index (K : Set G) K₀ := by
  unfold prehaar; rw [div_le_iff] <;> 

Proof state:
G : Type u_1
inst✝² : Group G
inst✝¹ : TopologicalSpace G
inst✝ : TopologicalGroup G
K₀ : PositiveCompacts G
U : Set G
K : Compacts G
hU : Set.Nonempty (interior U)
⊢ 0 < ↑(index (↑K₀) U)

Next tactic:
norm_cast
@[to_additive add_prehaar_le_addIndex]
theorem prehaar_le_index (K₀ : PositiveCompacts G) {U : Set G} (K : Compacts G)
    (hU : (interior U).Nonempty) : prehaar (K₀ : Set G) U K ≤ index (K : Set G) K₀ := by
  unfold prehaar; rw [div_le_iff] <;> norm_cast
  · 

Proof state:
G : Type u_1
inst✝² : Group G
inst✝¹ : TopologicalSpace G
inst✝ : TopologicalGroup G
K₀ : PositiveCompacts G
U : Set G
K : Compacts G
hU : Set.Nonempty (interior U)
⊢ index (↑K) U ≤ index ↑K ↑K₀ * index (↑K₀) U

Next tactic:
apply le_index_mul K₀ K hU
@[to_additive add_prehaar_le_addIndex]
theorem prehaar_le_index (K₀ : PositiveCompacts G) {U : Set G} (K : Compacts G)
    (hU : (interior U).Nonempty) : prehaar (K₀ : Set G) U K ≤ index (K : Set G) K₀ := by
  unfold prehaar; rw [div_le_iff] <;> norm_cast
  · apply le_index_mul K₀ K hU
  · 

Proof state:
G : Type u_1
inst✝² : Group G
inst✝¹ : TopologicalSpace G
inst✝ : TopologicalGroup G
K₀ : PositiveCompacts G
U : Set G
K : Compacts G
hU : Set.Nonempty (interior U)
⊢ 0 < index (↑K₀) U

Next tactic:
exact index_pos K₀ hU
@[to_additive]
theorem prehaar_pos (K₀ : PositiveCompacts G) {U : Set G} (hU : (interior U).Nonempty) {K : Set G}
    (h1K : IsCompact K) (h2K : (interior K).Nonempty) : 0 < prehaar (K₀ : Set G) U ⟨K, h1K⟩ := by
  

Proof state:
G : Type u_1
inst✝² : Group G
inst✝¹ : TopologicalSpace G
inst✝ : TopologicalGroup G
K₀ : PositiveCompacts G
U : Set G
hU : Set.Nonempty (interior U)
K : Set G
h1K : IsCompact K
h2K : Set.Nonempty (interior K)
⊢ 0 < prehaar (↑K₀) U { carrier := K, isCompact' := h1K }

Next tactic:
apply div_pos
@[to_additive]
theorem prehaar_pos (K₀ : PositiveCompacts G) {U : Set G} (hU : (interior U).Nonempty) {K : Set G}
    (h1K : IsCompact K) (h2K : (interior K).Nonempty) : 0 < prehaar (K₀ : Set G) U ⟨K, h1K⟩ := by
  apply div_pos <;> 

Proof state:
case ha
G : Type u_1
inst✝² : Group G
inst✝¹ : TopologicalSpace G
inst✝ : TopologicalGroup G
K₀ : PositiveCompacts G
U : Set G
hU : Set.Nonempty (interior U)
K : Set G
h1K : IsCompact K
h2K : Set.Nonempty (interior K)
⊢ 0 < ↑(index (↑{ carrier := K, isCompact' := h1K }) U)

Next tactic:
norm_cast
@[to_additive]
theorem prehaar_pos (K₀ : PositiveCompacts G) {U : Set G} (hU : (interior U).Nonempty) {K : Set G}
    (h1K : IsCompact K) (h2K : (interior K).Nonempty) : 0 < prehaar (K₀ : Set G) U ⟨K, h1K⟩ := by
  apply div_pos <;> 

Proof state:
case hb
G : Type u_1
inst✝² : Group G
inst✝¹ : TopologicalSpace G
inst✝ : TopologicalGroup G
K₀ : PositiveCompacts G
U : Set G
hU : Set.Nonempty (interior U)
K : Set G
h1K : IsCompact K
h2K : Set.Nonempty (interior K)
⊢ 0 < ↑(index (↑K₀) U)

Next tactic:
norm_cast
@[to_additive]
theorem prehaar_pos (K₀ : PositiveCompacts G) {U : Set G} (hU : (interior U).Nonempty) {K : Set G}
    (h1K : IsCompact K) (h2K : (interior K).Nonempty) : 0 < prehaar (K₀ : Set G) U ⟨K, h1K⟩ := by
  apply div_pos <;> norm_cast; 

Proof state:
case ha
G : Type u_1
inst✝² : Group G
inst✝¹ : TopologicalSpace G
inst✝ : TopologicalGroup G
K₀ : PositiveCompacts G
U : Set G
hU : Set.Nonempty (interior U)
K : Set G
h1K : IsCompact K
h2K : Set.Nonempty (interior K)
⊢ 0 < index (↑{ carrier := K, isCompact' := h1K }) U
case hb
G : Type u_1
inst✝² : Group G
inst✝¹ : TopologicalSpace G
inst✝ : TopologicalGroup G
K₀ : PositiveCompacts G
U : Set G
hU : Set.Nonempty (interior U)
K : Set G
h1K : IsCompact K
h2K : Set.Nonempty (interior K)
⊢ 0 < index (↑K₀) U

Next tactic:
apply index_pos ⟨⟨K, h1K⟩, h2K⟩ hU