l3lab/ntp-mathlib huggingface dataset:
@[to_additive]
instance inv.instIsMulRightInvariant [IsMulLeftInvariant μ] : IsMulRightInvariant μ.inv := by
  constructor
  intro g
  conv_rhs => 

Proof state:
𝕜 : Type u_1
G : Type u_2
H : Type u_3
inst✝⁵ : MeasurableSpace G
inst✝⁴ : MeasurableSpace H
inst✝³ : DivisionMonoid G
inst✝² : MeasurableMul G
inst✝¹ : MeasurableInv G
μ : Measure G
inst✝ : IsMulLeftInvariant μ
g : G
| Measure.inv μ

Next tactic:
rw [← map_mul_left_eq_self μ g⁻¹]
@[to_additive]
instance inv.instIsMulRightInvariant [IsMulLeftInvariant μ] : IsMulRightInvariant μ.inv := by
  constructor
  intro g
  conv_rhs => rw [← map_mul_left_eq_self μ g⁻¹]
  

Proof state:
case map_mul_right_eq_self
𝕜 : Type u_1
G : Type u_2
H : Type u_3
inst✝⁵ : MeasurableSpace G
inst✝⁴ : MeasurableSpace H
inst✝³ : DivisionMonoid G
inst✝² : MeasurableMul G
inst✝¹ : MeasurableInv G
μ : Measure G
inst✝ : IsMulLeftInvariant μ
g : G
⊢ map (fun x => x * g) (Measure.inv μ) = Measure.inv (map (fun x => g⁻¹ * x) μ)

Next tactic:
simp_rw [Measure.inv, map_map (measurable_mul_const g) measurable_inv,
    map_map measurable_inv (measurable_const_mul g⁻¹), Function.comp, mul_inv_rev, inv_inv]
@[to_additive]
instance inv.instIsMulLeftInvariant [IsMulRightInvariant μ] : IsMulLeftInvariant μ.inv := by
  

Proof state:
𝕜 : Type u_1
G : Type u_2
H : Type u_3
inst✝⁵ : MeasurableSpace G
inst✝⁴ : MeasurableSpace H
inst✝³ : DivisionMonoid G
inst✝² : MeasurableMul G
inst✝¹ : MeasurableInv G
μ : Measure G
inst✝ : IsMulRightInvariant μ
⊢ IsMulLeftInvariant (Measure.inv μ)

Next tactic:
constructor
@[to_additive]
instance inv.instIsMulLeftInvariant [IsMulRightInvariant μ] : IsMulLeftInvariant μ.inv := by
  constructor
  

Proof state:
case map_mul_left_eq_self
𝕜 : Type u_1
G : Type u_2
H : Type u_3
inst✝⁵ : MeasurableSpace G
inst✝⁴ : MeasurableSpace H
inst✝³ : DivisionMonoid G
inst✝² : MeasurableMul G
inst✝¹ : MeasurableInv G
μ : Measure G
inst✝ : IsMulRightInvariant μ
⊢ ∀ (g : G), map (fun x => g * x) (Measure.inv μ) = Measure.inv μ

Next tactic:
intro g
@[to_additive]
instance inv.instIsMulLeftInvariant [IsMulRightInvariant μ] : IsMulLeftInvariant μ.inv := by
  constructor
  intro g
  

Proof state:
case map_mul_left_eq_self
𝕜 : Type u_1
G : Type u_2
H : Type u_3
inst✝⁵ : MeasurableSpace G
inst✝⁴ : MeasurableSpace H
inst✝³ : DivisionMonoid G
inst✝² : MeasurableMul G
inst✝¹ : MeasurableInv G
μ : Measure G
inst✝ : IsMulRightInvariant μ
g : G
⊢ map (fun x => g * x) (Measure.inv μ) = Measure.inv μ

Next tactic:
conv_rhs => rw [← map_mul_right_eq_self μ g⁻¹]
@[to_additive]
instance inv.instIsMulLeftInvariant [IsMulRightInvariant μ] : IsMulLeftInvariant μ.inv := by
  constructor
  intro g
  conv_rhs => 

Proof state:
𝕜 : Type u_1
G : Type u_2
H : Type u_3
inst✝⁵ : MeasurableSpace G
inst✝⁴ : MeasurableSpace H
inst✝³ : DivisionMonoid G
inst✝² : MeasurableMul G
inst✝¹ : MeasurableInv G
μ : Measure G
inst✝ : IsMulRightInvariant μ
g : G
| Measure.inv μ

Next tactic:
rw [← map_mul_right_eq_self μ g⁻¹]
@[to_additive]
instance inv.instIsMulLeftInvariant [IsMulRightInvariant μ] : IsMulLeftInvariant μ.inv := by
  constructor
  intro g
  conv_rhs => rw [← map_mul_right_eq_self μ g⁻¹]
  

Proof state:
case map_mul_left_eq_self
𝕜 : Type u_1
G : Type u_2
H : Type u_3
inst✝⁵ : MeasurableSpace G
inst✝⁴ : MeasurableSpace H
inst✝³ : DivisionMonoid G
inst✝² : MeasurableMul G
inst✝¹ : MeasurableInv G
μ : Measure G
inst✝ : IsMulRightInvariant μ
g : G
⊢ map (fun x => g * x) (Measure.inv μ) = Measure.inv (map (fun x => x * g⁻¹) μ)

Next tactic:
simp_rw [Measure.inv, map_map (measurable_const_mul g) measurable_inv,
    map_map measurable_inv (measurable_mul_const g⁻¹), Function.comp, mul_inv_rev, inv_inv]
@[to_additive]
theorem measurePreserving_div_left (μ : Measure G) [IsInvInvariant μ] [IsMulLeftInvariant μ]
    (g : G) : MeasurePreserving (fun t => g / t) μ μ := by
  

Proof state:
𝕜 : Type u_1
G : Type u_2
H : Type u_3
inst✝⁶ : MeasurableSpace G
inst✝⁵ : MeasurableSpace H
inst✝⁴ : DivisionMonoid G
inst✝³ : MeasurableMul G
inst✝² : MeasurableInv G
μ✝ μ : Measure G
inst✝¹ : IsInvInvariant μ
inst✝ : IsMulLeftInvariant μ
g : G
⊢ MeasurePreserving fun t => g / t

Next tactic:
simp_rw [div_eq_mul_inv]
@[to_additive]
theorem measurePreserving_div_left (μ : Measure G) [IsInvInvariant μ] [IsMulLeftInvariant μ]
    (g : G) : MeasurePreserving (fun t => g / t) μ μ := by
  simp_rw [div_eq_mul_inv]
  

Proof state:
𝕜 : Type u_1
G : Type u_2
H : Type u_3
inst✝⁶ : MeasurableSpace G
inst✝⁵ : MeasurableSpace H
inst✝⁴ : DivisionMonoid G
inst✝³ : MeasurableMul G
inst✝² : MeasurableInv G
μ✝ μ : Measure G
inst✝¹ : IsInvInvariant μ
inst✝ : IsMulLeftInvariant μ
g : G
⊢ MeasurePreserving fun t => g * t⁻¹

Next tactic:
exact (measurePreserving_mul_left μ g).comp (measurePreserving_inv μ)
/-- If a left-invariant measure gives positive mass to a compact set, then it gives positive mass to
any open set. -/
@[to_additive
"If a left-invariant measure gives positive mass to a compact set, then it gives positive mass to
any open set."]
theorem isOpenPosMeasure_of_mulLeftInvariant_of_compact (K : Set G) (hK : IsCompact K)
    (h : μ K ≠ 0) : IsOpenPosMeasure μ := by
  

Proof state:
𝕜 : Type u_1
G : Type u_2
H : Type u_3
inst✝⁶ : MeasurableSpace G
inst✝⁵ : MeasurableSpace H
inst✝⁴ : TopologicalSpace G
inst✝³ : BorelSpace G
μ : Measure G
inst✝² : Group G
inst✝¹ : TopologicalGroup G
inst✝ : IsMulLeftInvariant μ
K : Set G
hK : IsCompact K
h : ↑↑μ K ≠ 0
⊢ IsOpenPosMeasure μ

Next tactic:
refine' ⟨fun U hU hne => _⟩
/-- If a left-invariant measure gives positive mass to a compact set, then it gives positive mass to
any open set. -/
@[to_additive
"If a left-invariant measure gives positive mass to a compact set, then it gives positive mass to
any open set."]
theorem isOpenPosMeasure_of_mulLeftInvariant_of_compact (K : Set G) (hK : IsCompact K)
    (h : μ K ≠ 0) : IsOpenPosMeasure μ := by
  refine' ⟨fun U hU hne => _⟩
  

Proof state:
𝕜 : Type u_1
G : Type u_2
H : Type u_3
inst✝⁶ : MeasurableSpace G
inst✝⁵ : MeasurableSpace H
inst✝⁴ : TopologicalSpace G
inst✝³ : BorelSpace G
μ : Measure G
inst✝² : Group G
inst✝¹ : TopologicalGroup G
inst✝ : IsMulLeftInvariant μ
K : Set G
hK : IsCompact K
h : ↑↑μ K ≠ 0
U : Set G
hU : IsOpen U
hne : Set.Nonempty U
⊢ ↑↑μ U ≠ 0

Next tactic:
contrapose! h
/-- If a left-invariant measure gives positive mass to a compact set, then it gives positive mass to
any open set. -/
@[to_additive
"If a left-invariant measure gives positive mass to a compact set, then it gives positive mass to
any open set."]
theorem isOpenPosMeasure_of_mulLeftInvariant_of_compact (K : Set G) (hK : IsCompact K)
    (h : μ K ≠ 0) : IsOpenPosMeasure μ := by
  refine' ⟨fun U hU hne => _⟩
  contrapose! h
  

Proof state:
𝕜 : Type u_1
G : Type u_2
H : Type u_3
inst✝⁶ : MeasurableSpace G
inst✝⁵ : MeasurableSpace H
inst✝⁴ : TopologicalSpace G
inst✝³ : BorelSpace G
μ : Measure G
inst✝² : Group G
inst✝¹ : TopologicalGroup G
inst✝ : IsMulLeftInvariant μ
K : Set G
hK : IsCompact K
U : Set G
hU : IsOpen U
hne : Set.Nonempty U
h : ↑↑μ U = 0
⊢ ↑↑μ K = 0

Next tactic:
rw [← nonpos_iff_eq_zero]
/-- If a left-invariant measure gives positive mass to a compact set, then it gives positive mass to
any open set. -/
@[to_additive
"If a left-invariant measure gives positive mass to a compact set, then it gives positive mass to
any open set."]
theorem isOpenPosMeasure_of_mulLeftInvariant_of_compact (K : Set G) (hK : IsCompact K)
    (h : μ K ≠ 0) : IsOpenPosMeasure μ := by
  refine' ⟨fun U hU hne => _⟩
  contrapose! h
  rw [← nonpos_iff_eq_zero]
  

Proof state:
𝕜 : Type u_1
G : Type u_2
H : Type u_3
inst✝⁶ : MeasurableSpace G
inst✝⁵ : MeasurableSpace H
inst✝⁴ : TopologicalSpace G
inst✝³ : BorelSpace G
μ : Measure G
inst✝² : Group G
inst✝¹ : TopologicalGroup G
inst✝ : IsMulLeftInvariant μ
K : Set G
hK : IsCompact K
U : Set G
hU : IsOpen U
hne : Set.Nonempty U
h : ↑↑μ U = 0
⊢ ↑↑μ K ≤ 0

Next tactic:
rw [← hU.interior_eq] at hne
/-- If a left-invariant measure gives positive mass to a compact set, then it gives positive mass to
any open set. -/
@[to_additive
"If a left-invariant measure gives positive mass to a compact set, then it gives positive mass to
any open set."]
theorem isOpenPosMeasure_of_mulLeftInvariant_of_compact (K : Set G) (hK : IsCompact K)
    (h : μ K ≠ 0) : IsOpenPosMeasure μ := by
  refine' ⟨fun U hU hne => _⟩
  contrapose! h
  rw [← nonpos_iff_eq_zero]
  rw [← hU.interior_eq] at hne
  

Proof state:
𝕜 : Type u_1
G : Type u_2
H : Type u_3
inst✝⁶ : MeasurableSpace G
inst✝⁵ : MeasurableSpace H
inst✝⁴ : TopologicalSpace G
inst✝³ : BorelSpace G
μ : Measure G
inst✝² : Group G
inst✝¹ : TopologicalGroup G
inst✝ : IsMulLeftInvariant μ
K : Set G
hK : IsCompact K
U : Set G
hU : IsOpen U
hne : Set.Nonempty (interior U)
h : ↑↑μ U = 0
⊢ ↑↑μ K ≤ 0

Next tactic:
obtain ⟨t, hKt⟩ : ∃ t : Finset G, K ⊆ ⋃ (g : G) (_ : g ∈ t), (fun h : G => g * h) ⁻¹' U :=
    compact_covered_by_mul_left_translates hK hne
/-- If a left-invariant measure gives positive mass to a compact set, then it gives positive mass to
any open set. -/
@[to_additive
"If a left-invariant measure gives positive mass to a compact set, then it gives positive mass to
any open set."]
theorem isOpenPosMeasure_of_mulLeftInvariant_of_compact (K : Set G) (hK : IsCompact K)
    (h : μ K ≠ 0) : IsOpenPosMeasure μ := by
  refine' ⟨fun U hU hne => _⟩
  contrapose! h
  rw [← nonpos_iff_eq_zero]
  rw [← hU.interior_eq] at hne
  obtain ⟨t, hKt⟩ : ∃ t : Finset G, K ⊆ ⋃ (g : G) (_ : g ∈ t), (fun h : G => g * h) ⁻¹' U :=
    compact_covered_by_mul_left_translates hK hne
  

Proof state:
case intro
𝕜 : Type u_1
G : Type u_2
H : Type u_3
inst✝⁶ : MeasurableSpace G
inst✝⁵ : MeasurableSpace H
inst✝⁴ : TopologicalSpace G
inst✝³ : BorelSpace G
μ : Measure G
inst✝² : Group G
inst✝¹ : TopologicalGroup G
inst✝ : IsMulLeftInvariant μ
K : Set G
hK : IsCompact K
U : Set G
hU : IsOpen U
hne : Set.Nonempty (interior U)
h : ↑↑μ U = 0
t : Finset G
hKt : K ⊆ ⋃ g ∈ t, (fun h => g * h) ⁻¹' U
⊢ ↑↑μ K ≤ 0

Next tactic:
calc
    μ K ≤ μ (⋃ (g : G) (_ : g ∈ t), (fun h : G => g * h) ⁻¹' U) := measure_mono hKt
    _ ≤ ∑ g in t, μ ((fun h : G => g * h) ⁻¹' U) := (measure_biUnion_finset_le _ _)
    _ = 0 := by simp [measure_preimage_mul, h]
/-- If a left-invariant measure gives positive mass to a compact set, then it gives positive mass to
any open set. -/
@[to_additive
"If a left-invariant measure gives positive mass to a compact set, then it gives positive mass to
any open set."]
theorem isOpenPosMeasure_of_mulLeftInvariant_of_compact (K : Set G) (hK : IsCompact K)
    (h : μ K ≠ 0) : IsOpenPosMeasure μ := by
  refine' ⟨fun U hU hne => _⟩
  contrapose! h
  rw [← nonpos_iff_eq_zero]
  rw [← hU.interior_eq] at hne
  obtain ⟨t, hKt⟩ : ∃ t : Finset G, K ⊆ ⋃ (g : G) (_ : g ∈ t), (fun h : G => g * h) ⁻¹' U :=
    compact_covered_by_mul_left_translates hK hne
  calc
    μ K ≤ μ (⋃ (g : G) (_ : g ∈ t), (fun h : G => g * h) ⁻¹' U) := measure_mono hKt
    _ ≤ ∑ g in t, μ ((fun h : G => g * h) ⁻¹' U) := (measure_biUnion_finset_le _ _)
    _ = 0 := by 

Proof state:
𝕜 : Type u_1
G : Type u_2
H : Type u_3
inst✝⁶ : MeasurableSpace G
inst✝⁵ : MeasurableSpace H
inst✝⁴ : TopologicalSpace G
inst✝³ : BorelSpace G
μ : Measure G
inst✝² : Group G
inst✝¹ : TopologicalGroup G
inst✝ : IsMulLeftInvariant μ
K : Set G
hK : IsCompact K
U : Set G
hU : IsOpen U
hne : Set.Nonempty (interior U)
h : ↑↑μ U = 0
t : Finset G
hKt : K ⊆ ⋃ g ∈ t, (fun h => g * h) ⁻¹' U
⊢ ∑ g in t, ↑↑μ ((fun h => g * h) ⁻¹' U) = 0

Next tactic:
simp [measure_preimage_mul, h]
@[to_additive]
theorem null_iff_of_isMulLeftInvariant [Regular μ] {s : Set G} (hs : IsOpen s) :
    μ s = 0 ↔ s = ∅ ∨ μ = 0 := by
  

Proof state:
𝕜 : Type u_1
G : Type u_2
H : Type u_3
inst✝⁷ : MeasurableSpace G
inst✝⁶ : MeasurableSpace H
inst✝⁵ : TopologicalSpace G
inst✝⁴ : BorelSpace G
μ : Measure G
inst✝³ : Group G
inst✝² : TopologicalGroup G
inst✝¹ : IsMulLeftInvariant μ
inst✝ : Regular μ
s : Set G
hs : IsOpen s
⊢ ↑↑μ s = 0 ↔ s = ∅ ∨ μ = 0

Next tactic:
rcases eq_zero_or_neZero μ with rfl|hμ
@[to_additive]
theorem null_iff_of_isMulLeftInvariant [Regular μ] {s : Set G} (hs : IsOpen s) :
    μ s = 0 ↔ s = ∅ ∨ μ = 0 := by
  rcases eq_zero_or_neZero μ with rfl|hμ
  · 

Proof state:
case inl
𝕜 : Type u_1
G : Type u_2
H : Type u_3
inst✝⁷ : MeasurableSpace G
inst✝⁶ : MeasurableSpace H
inst✝⁵ : TopologicalSpace G
inst✝⁴ : BorelSpace G
inst✝³ : Group G
inst✝² : TopologicalGroup G
s : Set G
hs : IsOpen s
inst✝¹ : IsMulLeftInvariant 0
inst✝ : Regular 0
⊢ ↑↑0 s = 0 ↔ s = ∅ ∨ 0 = 0

Next tactic:
simp
@[to_additive]
theorem null_iff_of_isMulLeftInvariant [Regular μ] {s : Set G} (hs : IsOpen s) :
    μ s = 0 ↔ s = ∅ ∨ μ = 0 := by
  rcases eq_zero_or_neZero μ with rfl|hμ
  · simp
  · 

Proof state:
case inr
𝕜 : Type u_1
G : Type u_2
H : Type u_3
inst✝⁷ : MeasurableSpace G
inst✝⁶ : MeasurableSpace H
inst✝⁵ : TopologicalSpace G
inst✝⁴ : BorelSpace G
μ : Measure G
inst✝³ : Group G
inst✝² : TopologicalGroup G
inst✝¹ : IsMulLeftInvariant μ
inst✝ : Regular μ
s : Set G
hs : IsOpen s
hμ : NeZero μ
⊢ ↑↑μ s = 0 ↔ s = ∅ ∨ μ = 0

Next tactic:
simp only [or_false_iff, hs.measure_eq_zero_iff μ, NeZero.ne μ]
@[to_additive]
theorem measure_ne_zero_iff_nonempty_of_isMulLeftInvariant [Regular μ] (hμ : μ ≠ 0) {s : Set G}
    (hs : IsOpen s) : μ s ≠ 0 ↔ s.Nonempty := by
  

Proof state:
𝕜 : Type u_1
G : Type u_2
H : Type u_3
inst✝⁷ : MeasurableSpace G
inst✝⁶ : MeasurableSpace H
inst✝⁵ : TopologicalSpace G
inst✝⁴ : BorelSpace G
μ : Measure G
inst✝³ : Group G
inst✝² : TopologicalGroup G
inst✝¹ : IsMulLeftInvariant μ
inst✝ : Regular μ
hμ : μ ≠ 0
s : Set G
hs : IsOpen s
⊢ ↑↑μ s ≠ 0 ↔ Set.Nonempty s

Next tactic:
simpa [null_iff_of_isMulLeftInvariant (μ := μ) hs, hμ] using nonempty_iff_ne_empty.symm
/-- If a left-invariant measure gives finite mass to a nonempty open set, then it gives finite mass
to any compact set. -/
@[to_additive
"If a left-invariant measure gives finite mass to a nonempty open set, then it gives finite mass to
any compact set."]
theorem measure_lt_top_of_isCompact_of_isMulLeftInvariant (U : Set G) (hU : IsOpen U)
    (h'U : U.Nonempty) (h : μ U ≠ ∞) {K : Set G} (hK : IsCompact K) : μ K < ∞ := by
  

Proof state:
𝕜 : Type u_1
G : Type u_2
H : Type u_3
inst✝⁶ : MeasurableSpace G
inst✝⁵ : MeasurableSpace H
inst✝⁴ : TopologicalSpace G
inst✝³ : BorelSpace G
μ : Measure G
inst✝² : Group G
inst✝¹ : TopologicalGroup G
inst✝ : IsMulLeftInvariant μ
U : Set G
hU : IsOpen U
h'U : Set.Nonempty U
h : ↑↑μ U ≠ ⊤
K : Set G
hK : IsCompact K
⊢ ↑↑μ K < ⊤

Next tactic:
rw [← hU.interior_eq] at h'U
/-- If a left-invariant measure gives finite mass to a nonempty open set, then it gives finite mass
to any compact set. -/
@[to_additive
"If a left-invariant measure gives finite mass to a nonempty open set, then it gives finite mass to
any compact set."]
theorem measure_lt_top_of_isCompact_of_isMulLeftInvariant (U : Set G) (hU : IsOpen U)
    (h'U : U.Nonempty) (h : μ U ≠ ∞) {K : Set G} (hK : IsCompact K) : μ K < ∞ := by
  rw [← hU.interior_eq] at h'U
  

Proof state:
𝕜 : Type u_1
G : Type u_2
H : Type u_3
inst✝⁶ : MeasurableSpace G
inst✝⁵ : MeasurableSpace H
inst✝⁴ : TopologicalSpace G
inst✝³ : BorelSpace G
μ : Measure G
inst✝² : Group G
inst✝¹ : TopologicalGroup G
inst✝ : IsMulLeftInvariant μ
U : Set G
hU : IsOpen U
h'U : Set.Nonempty (interior U)
h : ↑↑μ U ≠ ⊤
K : Set G
hK : IsCompact K
⊢ ↑↑μ K < ⊤

Next tactic:
obtain ⟨t, hKt⟩ : ∃ t : Finset G, K ⊆ ⋃ (g : G) (_ : g ∈ t), (fun h : G => g * h) ⁻¹' U :=
    compact_covered_by_mul_left_translates hK h'U
/-- If a left-invariant measure gives finite mass to a nonempty open set, then it gives finite mass
to any compact set. -/
@[to_additive
"If a left-invariant measure gives finite mass to a nonempty open set, then it gives finite mass to
any compact set."]
theorem measure_lt_top_of_isCompact_of_isMulLeftInvariant (U : Set G) (hU : IsOpen U)
    (h'U : U.Nonempty) (h : μ U ≠ ∞) {K : Set G} (hK : IsCompact K) : μ K < ∞ := by
  rw [← hU.interior_eq] at h'U
  obtain ⟨t, hKt⟩ : ∃ t : Finset G, K ⊆ ⋃ (g : G) (_ : g ∈ t), (fun h : G => g * h) ⁻¹' U :=
    compact_covered_by_mul_left_translates hK h'U
  

Proof state:
case intro
𝕜 : Type u_1
G : Type u_2
H : Type u_3
inst✝⁶ : MeasurableSpace G
inst✝⁵ : MeasurableSpace H
inst✝⁴ : TopologicalSpace G
inst✝³ : BorelSpace G
μ : Measure G
inst✝² : Group G
inst✝¹ : TopologicalGroup G
inst✝ : IsMulLeftInvariant μ
U : Set G
hU : IsOpen U
h'U : Set.Nonempty (interior U)
h : ↑↑μ U ≠ ⊤
K : Set G
hK : IsCompact K
t : Finset G
hKt : K ⊆ ⋃ g ∈ t, (fun h => g * h) ⁻¹' U
⊢ ↑↑μ K < ⊤

Next tactic:
calc
    μ K ≤ μ (⋃ (g : G) (_ : g ∈ t), (fun h : G => g * h) ⁻¹' U) := measure_mono hKt
    _ ≤ ∑ g in t, μ ((fun h : G => g * h) ⁻¹' U) := (measure_biUnion_finset_le _ _)
    _ = Finset.card t * μ U := by simp only [measure_preimage_mul, Finset.sum_const, nsmul_eq_mul]
    _ < ∞ := ENNReal.mul_lt_top (ENNReal.nat_ne_top _) h
/-- If a left-invariant measure gives finite mass to a nonempty open set, then it gives finite mass
to any compact set. -/
@[to_additive
"If a left-invariant measure gives finite mass to a nonempty open set, then it gives finite mass to
any compact set."]
theorem measure_lt_top_of_isCompact_of_isMulLeftInvariant (U : Set G) (hU : IsOpen U)
    (h'U : U.Nonempty) (h : μ U ≠ ∞) {K : Set G} (hK : IsCompact K) : μ K < ∞ := by
  rw [← hU.interior_eq] at h'U
  obtain ⟨t, hKt⟩ : ∃ t : Finset G, K ⊆ ⋃ (g : G) (_ : g ∈ t), (fun h : G => g * h) ⁻¹' U :=
    compact_covered_by_mul_left_translates hK h'U
  calc
    μ K ≤ μ (⋃ (g : G) (_ : g ∈ t), (fun h : G => g * h) ⁻¹' U) := measure_mono hKt
    _ ≤ ∑ g in t, μ ((fun h : G => g * h) ⁻¹' U) := (measure_biUnion_finset_le _ _)
    _ = Finset.card t * μ U := by 

Proof state:
𝕜 : Type u_1
G : Type u_2
H : Type u_3
inst✝⁶ : MeasurableSpace G
inst✝⁵ : MeasurableSpace H
inst✝⁴ : TopologicalSpace G
inst✝³ : BorelSpace G
μ : Measure G
inst✝² : Group G
inst✝¹ : TopologicalGroup G
inst✝ : IsMulLeftInvariant μ
U : Set G
hU : IsOpen U
h'U : Set.Nonempty (interior U)
h : ↑↑μ U ≠ ⊤
K : Set G
hK : IsCompact K
t : Finset G
hKt : K ⊆ ⋃ g ∈ t, (fun h => g * h) ⁻¹' U
⊢ ∑ g in t, ↑↑μ ((fun h => g * h) ⁻¹' U) = ↑(Finset.card t) * ↑↑μ U

Next tactic:
simp only [measure_preimage_mul, Finset.sum_const, nsmul_eq_mul]
/-- In a noncompact locally compact group, a left-invariant measure which is positive
on open sets has infinite mass. -/
@[to_additive (attr := simp)
"In a noncompact locally compact additive group, a left-invariant measure which is positive on open
sets has infinite mass."]
theorem measure_univ_of_isMulLeftInvariant [WeaklyLocallyCompactSpace G] [NoncompactSpace G]
    (μ : Measure G) [IsOpenPosMeasure μ] [μ.IsMulLeftInvariant] : μ univ = ∞ := by
  /- Consider a closed compact set `K` with nonempty interior. For any compact set `L`, one may
    find `g = g (L)` such that `L` is disjoint from `g • K`. Iterating this, one finds
    infinitely many translates of `K` which are disjoint from each other. As they all have the
    same positive mass, it follows that the space has infinite measure. -/
  

Proof state:
𝕜 : Type u_1
G : Type u_2
H : Type u_3
inst✝¹⁰ : MeasurableSpace G
inst✝⁹ : MeasurableSpace H
inst✝⁸ : TopologicalSpace G
inst✝⁷ : BorelSpace G
μ✝ : Measure G
inst✝⁶ : Group G
inst✝⁵ : TopologicalGroup G
inst✝⁴ : IsMulLeftInvariant μ✝
inst✝³ : WeaklyLocallyCompactSpace G
inst✝² : NoncompactSpace G
μ : Measure G
inst✝¹ : IsOpenPosMeasure μ
inst✝ : IsMulLeftInvariant μ
⊢ ↑↑μ univ = ⊤

Next tactic:
obtain ⟨K, hK, Kclosed, K1⟩ : ∃ K : Set G, IsCompact K ∧ IsClosed K ∧ K ∈ 𝓝 1 :=
    exists_isCompact_isClosed_nhds_one G
/-- In a noncompact locally compact group, a left-invariant measure which is positive
on open sets has infinite mass. -/
@[to_additive (attr := simp)
"In a noncompact locally compact additive group, a left-invariant measure which is positive on open
sets has infinite mass."]
theorem measure_univ_of_isMulLeftInvariant [WeaklyLocallyCompactSpace G] [NoncompactSpace G]
    (μ : Measure G) [IsOpenPosMeasure μ] [μ.IsMulLeftInvariant] : μ univ = ∞ := by
  /- Consider a closed compact set `K` with nonempty interior. For any compact set `L`, one may
    find `g = g (L)` such that `L` is disjoint from `g • K`. Iterating this, one finds
    infinitely many translates of `K` which are disjoint from each other. As they all have the
    same positive mass, it follows that the space has infinite measure. -/
  obtain ⟨K, hK, Kclosed, K1⟩ : ∃ K : Set G, IsCompact K ∧ IsClosed K ∧ K ∈ 𝓝 1 :=
    exists_isCompact_isClosed_nhds_one G
  

Proof state:
case intro.intro.intro
𝕜 : Type u_1
G : Type u_2
H : Type u_3
inst✝¹⁰ : MeasurableSpace G
inst✝⁹ : MeasurableSpace H
inst✝⁸ : TopologicalSpace G
inst✝⁷ : BorelSpace G
μ✝ : Measure G
inst✝⁶ : Group G
inst✝⁵ : TopologicalGroup G
inst✝⁴ : IsMulLeftInvariant μ✝
inst✝³ : WeaklyLocallyCompactSpace G
inst✝² : NoncompactSpace G
μ : Measure G
inst✝¹ : IsOpenPosMeasure μ
inst✝ : IsMulLeftInvariant μ
K : Set G
hK : IsCompact K
Kclosed : IsClosed K
K1 : K ∈ 𝓝 1
⊢ ↑↑μ univ = ⊤

Next tactic:
have K_pos : 0 < μ K := measure_pos_of_nonempty_interior _ ⟨_, mem_interior_iff_mem_nhds.2 K1⟩
/-- In a noncompact locally compact group, a left-invariant measure which is positive
on open sets has infinite mass. -/
@[to_additive (attr := simp)
"In a noncompact locally compact additive group, a left-invariant measure which is positive on open
sets has infinite mass."]
theorem measure_univ_of_isMulLeftInvariant [WeaklyLocallyCompactSpace G] [NoncompactSpace G]
    (μ : Measure G) [IsOpenPosMeasure μ] [μ.IsMulLeftInvariant] : μ univ = ∞ := by
  /- Consider a closed compact set `K` with nonempty interior. For any compact set `L`, one may
    find `g = g (L)` such that `L` is disjoint from `g • K`. Iterating this, one finds
    infinitely many translates of `K` which are disjoint from each other. As they all have the
    same positive mass, it follows that the space has infinite measure. -/
  obtain ⟨K, hK, Kclosed, K1⟩ : ∃ K : Set G, IsCompact K ∧ IsClosed K ∧ K ∈ 𝓝 1 :=
    exists_isCompact_isClosed_nhds_one G
  have K_pos : 0 < μ K := measure_pos_of_nonempty_interior _ ⟨_, mem_interior_iff_mem_nhds.2 K1⟩
  

Proof state:
case intro.intro.intro
𝕜 : Type u_1
G : Type u_2
H : Type u_3
inst✝¹⁰ : MeasurableSpace G
inst✝⁹ : MeasurableSpace H
inst✝⁸ : TopologicalSpace G
inst✝⁷ : BorelSpace G
μ✝ : Measure G
inst✝⁶ : Group G
inst✝⁵ : TopologicalGroup G
inst✝⁴ : IsMulLeftInvariant μ✝
inst✝³ : WeaklyLocallyCompactSpace G
inst✝² : NoncompactSpace G
μ : Measure G
inst✝¹ : IsOpenPosMeasure μ
inst✝ : IsMulLeftInvariant μ
K : Set G
hK : IsCompact K
Kclosed : IsClosed K
K1 : K ∈ 𝓝 1
K_pos : 0 < ↑↑μ K
⊢ ↑↑μ univ = ⊤

Next tactic:
have A : ∀ L : Set G, IsCompact L → ∃ g : G, Disjoint L (g • K) := fun L hL =>
    exists_disjoint_smul_of_isCompact hL hK
/-- In a noncompact locally compact group, a left-invariant measure which is positive
on open sets has infinite mass. -/
@[to_additive (attr := simp)
"In a noncompact locally compact additive group, a left-invariant measure which is positive on open
sets has infinite mass."]
theorem measure_univ_of_isMulLeftInvariant [WeaklyLocallyCompactSpace G] [NoncompactSpace G]
    (μ : Measure G) [IsOpenPosMeasure μ] [μ.IsMulLeftInvariant] : μ univ = ∞ := by
  /- Consider a closed compact set `K` with nonempty interior. For any compact set `L`, one may
    find `g = g (L)` such that `L` is disjoint from `g • K`. Iterating this, one finds
    infinitely many translates of `K` which are disjoint from each other. As they all have the
    same positive mass, it follows that the space has infinite measure. -/
  obtain ⟨K, hK, Kclosed, K1⟩ : ∃ K : Set G, IsCompact K ∧ IsClosed K ∧ K ∈ 𝓝 1 :=
    exists_isCompact_isClosed_nhds_one G
  have K_pos : 0 < μ K := measure_pos_of_nonempty_interior _ ⟨_, mem_interior_iff_mem_nhds.2 K1⟩
  have A : ∀ L : Set G, IsCompact L → ∃ g : G, Disjoint L (g • K) := fun L hL =>
    exists_disjoint_smul_of_isCompact hL hK
  

Proof state:
case intro.intro.intro
𝕜 : Type u_1
G : Type u_2
H : Type u_3
inst✝¹⁰ : MeasurableSpace G
inst✝⁹ : MeasurableSpace H
inst✝⁸ : TopologicalSpace G
inst✝⁷ : BorelSpace G
μ✝ : Measure G
inst✝⁶ : Group G
inst✝⁵ : TopologicalGroup G
inst✝⁴ : IsMulLeftInvariant μ✝
inst✝³ : WeaklyLocallyCompactSpace G
inst✝² : NoncompactSpace G
μ : Measure G
inst✝¹ : IsOpenPosMeasure μ
inst✝ : IsMulLeftInvariant μ
K : Set G
hK : IsCompact K
Kclosed : IsClosed K
K1 : K ∈ 𝓝 1
K_pos : 0 < ↑↑μ K
A : ∀ (L : Set G), IsCompact L → ∃ g, Disjoint L (g • K)
⊢ ↑↑μ univ = ⊤

Next tactic:
choose! g hg using A