l3lab/ntp-mathlib huggingface dataset:
/-- Any inner regular Haar measure is invariant under inversion in an abelian group. -/
@[to_additive "Any regular additive Haar measure is invariant under negation in an abelian group."]
instance (priority := 100) IsHaarMeasure.isInvInvariant_of_innerRegular
    [LocallyCompactSpace G] [InnerRegular μ] : IsInvInvariant μ := by
  -- the image measure is a Haar measure. By uniqueness up to multiplication, it is of the form
  -- `c μ`. Applying again inversion, one gets the measure `c^2 μ`. But since inversion is an
  -- involution, this is also `μ`. Hence, `c^2 = 1`, which implies `c = 1`.
  constructor
  have : IsHaarMeasure μ.inv := (MulEquiv.inv G).isHaarMeasure_map μ continuous_inv continuous_inv
  obtain ⟨c, _, _, hc⟩ : ∃ c : ℝ≥0∞, c ≠ 0 ∧ c ≠ ∞ ∧ μ.inv = c • μ :=
    isHaarMeasure_eq_smul_of_innerRegular _ _
  have : map Inv.inv (map Inv.inv μ) = c ^ 2 • μ := by
    

Proof state:
G : Type u_1
inst✝⁷ : CommGroup G
inst✝⁶ : TopologicalSpace G
inst✝⁵ : TopologicalGroup G
inst✝⁴ : MeasurableSpace G
inst✝³ : BorelSpace G
μ : Measure G
inst✝² : IsHaarMeasure μ
inst✝¹ : LocallyCompactSpace G
inst✝ : InnerRegular μ
this : IsHaarMeasure (Measure.inv μ)
c : ℝ≥0∞
left✝¹ : c ≠ 0
left✝ : c ≠ ⊤
hc : Measure.inv μ = c • μ
⊢ map Inv.inv (map Inv.inv μ) = c ^ 2 • μ

Next tactic:
rw [← inv_def μ, hc, Measure.map_smul, ← inv_def μ, hc, smul_smul, pow_two]
/-- Any inner regular Haar measure is invariant under inversion in an abelian group. -/
@[to_additive "Any regular additive Haar measure is invariant under negation in an abelian group."]
instance (priority := 100) IsHaarMeasure.isInvInvariant_of_innerRegular
    [LocallyCompactSpace G] [InnerRegular μ] : IsInvInvariant μ := by
  -- the image measure is a Haar measure. By uniqueness up to multiplication, it is of the form
  -- `c μ`. Applying again inversion, one gets the measure `c^2 μ`. But since inversion is an
  -- involution, this is also `μ`. Hence, `c^2 = 1`, which implies `c = 1`.
  constructor
  have : IsHaarMeasure μ.inv := (MulEquiv.inv G).isHaarMeasure_map μ continuous_inv continuous_inv
  obtain ⟨c, _, _, hc⟩ : ∃ c : ℝ≥0∞, c ≠ 0 ∧ c ≠ ∞ ∧ μ.inv = c • μ :=
    isHaarMeasure_eq_smul_of_innerRegular _ _
  have : map Inv.inv (map Inv.inv μ) = c ^ 2 • μ := by
    rw [← inv_def μ, hc, Measure.map_smul, ← inv_def μ, hc, smul_smul, pow_two]
  

Proof state:
case inv_eq_self.intro.intro.intro
G : Type u_1
inst✝⁷ : CommGroup G
inst✝⁶ : TopologicalSpace G
inst✝⁵ : TopologicalGroup G
inst✝⁴ : MeasurableSpace G
inst✝³ : BorelSpace G
μ : Measure G
inst✝² : IsHaarMeasure μ
inst✝¹ : LocallyCompactSpace G
inst✝ : InnerRegular μ
this✝ : IsHaarMeasure (Measure.inv μ)
c : ℝ≥0∞
left✝¹ : c ≠ 0
left✝ : c ≠ ⊤
hc : Measure.inv μ = c • μ
this : map Inv.inv (map Inv.inv μ) = c ^ 2 • μ
⊢ Measure.inv μ = μ

Next tactic:
have μeq : μ = c ^ 2 • μ := by
    rw [map_map continuous_inv.measurable continuous_inv.measurable] at this
    simpa only [inv_involutive, Involutive.comp_self, Measure.map_id]
/-- Any inner regular Haar measure is invariant under inversion in an abelian group. -/
@[to_additive "Any regular additive Haar measure is invariant under negation in an abelian group."]
instance (priority := 100) IsHaarMeasure.isInvInvariant_of_innerRegular
    [LocallyCompactSpace G] [InnerRegular μ] : IsInvInvariant μ := by
  -- the image measure is a Haar measure. By uniqueness up to multiplication, it is of the form
  -- `c μ`. Applying again inversion, one gets the measure `c^2 μ`. But since inversion is an
  -- involution, this is also `μ`. Hence, `c^2 = 1`, which implies `c = 1`.
  constructor
  have : IsHaarMeasure μ.inv := (MulEquiv.inv G).isHaarMeasure_map μ continuous_inv continuous_inv
  obtain ⟨c, _, _, hc⟩ : ∃ c : ℝ≥0∞, c ≠ 0 ∧ c ≠ ∞ ∧ μ.inv = c • μ :=
    isHaarMeasure_eq_smul_of_innerRegular _ _
  have : map Inv.inv (map Inv.inv μ) = c ^ 2 • μ := by
    rw [← inv_def μ, hc, Measure.map_smul, ← inv_def μ, hc, smul_smul, pow_two]
  have μeq : μ = c ^ 2 • μ := by
    

Proof state:
G : Type u_1
inst✝⁷ : CommGroup G
inst✝⁶ : TopologicalSpace G
inst✝⁵ : TopologicalGroup G
inst✝⁴ : MeasurableSpace G
inst✝³ : BorelSpace G
μ : Measure G
inst✝² : IsHaarMeasure μ
inst✝¹ : LocallyCompactSpace G
inst✝ : InnerRegular μ
this✝ : IsHaarMeasure (Measure.inv μ)
c : ℝ≥0∞
left✝¹ : c ≠ 0
left✝ : c ≠ ⊤
hc : Measure.inv μ = c • μ
this : map Inv.inv (map Inv.inv μ) = c ^ 2 • μ
⊢ μ = c ^ 2 • μ

Next tactic:
rw [map_map continuous_inv.measurable continuous_inv.measurable] at this
/-- Any inner regular Haar measure is invariant under inversion in an abelian group. -/
@[to_additive "Any regular additive Haar measure is invariant under negation in an abelian group."]
instance (priority := 100) IsHaarMeasure.isInvInvariant_of_innerRegular
    [LocallyCompactSpace G] [InnerRegular μ] : IsInvInvariant μ := by
  -- the image measure is a Haar measure. By uniqueness up to multiplication, it is of the form
  -- `c μ`. Applying again inversion, one gets the measure `c^2 μ`. But since inversion is an
  -- involution, this is also `μ`. Hence, `c^2 = 1`, which implies `c = 1`.
  constructor
  have : IsHaarMeasure μ.inv := (MulEquiv.inv G).isHaarMeasure_map μ continuous_inv continuous_inv
  obtain ⟨c, _, _, hc⟩ : ∃ c : ℝ≥0∞, c ≠ 0 ∧ c ≠ ∞ ∧ μ.inv = c • μ :=
    isHaarMeasure_eq_smul_of_innerRegular _ _
  have : map Inv.inv (map Inv.inv μ) = c ^ 2 • μ := by
    rw [← inv_def μ, hc, Measure.map_smul, ← inv_def μ, hc, smul_smul, pow_two]
  have μeq : μ = c ^ 2 • μ := by
    rw [map_map continuous_inv.measurable continuous_inv.measurable] at this
    

Proof state:
G : Type u_1
inst✝⁷ : CommGroup G
inst✝⁶ : TopologicalSpace G
inst✝⁵ : TopologicalGroup G
inst✝⁴ : MeasurableSpace G
inst✝³ : BorelSpace G
μ : Measure G
inst✝² : IsHaarMeasure μ
inst✝¹ : LocallyCompactSpace G
inst✝ : InnerRegular μ
this✝ : IsHaarMeasure (Measure.inv μ)
c : ℝ≥0∞
left✝¹ : c ≠ 0
left✝ : c ≠ ⊤
hc : Measure.inv μ = c • μ
this : map ((fun a => a⁻¹) ∘ fun a => a⁻¹) μ = c ^ 2 • μ
⊢ μ = c ^ 2 • μ

Next tactic:
simpa only [inv_involutive, Involutive.comp_self, Measure.map_id]
/-- Any inner regular Haar measure is invariant under inversion in an abelian group. -/
@[to_additive "Any regular additive Haar measure is invariant under negation in an abelian group."]
instance (priority := 100) IsHaarMeasure.isInvInvariant_of_innerRegular
    [LocallyCompactSpace G] [InnerRegular μ] : IsInvInvariant μ := by
  -- the image measure is a Haar measure. By uniqueness up to multiplication, it is of the form
  -- `c μ`. Applying again inversion, one gets the measure `c^2 μ`. But since inversion is an
  -- involution, this is also `μ`. Hence, `c^2 = 1`, which implies `c = 1`.
  constructor
  have : IsHaarMeasure μ.inv := (MulEquiv.inv G).isHaarMeasure_map μ continuous_inv continuous_inv
  obtain ⟨c, _, _, hc⟩ : ∃ c : ℝ≥0∞, c ≠ 0 ∧ c ≠ ∞ ∧ μ.inv = c • μ :=
    isHaarMeasure_eq_smul_of_innerRegular _ _
  have : map Inv.inv (map Inv.inv μ) = c ^ 2 • μ := by
    rw [← inv_def μ, hc, Measure.map_smul, ← inv_def μ, hc, smul_smul, pow_two]
  have μeq : μ = c ^ 2 • μ := by
    rw [map_map continuous_inv.measurable continuous_inv.measurable] at this
    simpa only [inv_involutive, Involutive.comp_self, Measure.map_id]
  

Proof state:
case inv_eq_self.intro.intro.intro
G : Type u_1
inst✝⁷ : CommGroup G
inst✝⁶ : TopologicalSpace G
inst✝⁵ : TopologicalGroup G
inst✝⁴ : MeasurableSpace G
inst✝³ : BorelSpace G
μ : Measure G
inst✝² : IsHaarMeasure μ
inst✝¹ : LocallyCompactSpace G
inst✝ : InnerRegular μ
this✝ : IsHaarMeasure (Measure.inv μ)
c : ℝ≥0∞
left✝¹ : c ≠ 0
left✝ : c ≠ ⊤
hc : Measure.inv μ = c • μ
this : map Inv.inv (map Inv.inv μ) = c ^ 2 • μ
μeq : μ = c ^ 2 • μ
⊢ Measure.inv μ = μ

Next tactic:
have K : PositiveCompacts G := Classical.arbitrary _
/-- Any inner regular Haar measure is invariant under inversion in an abelian group. -/
@[to_additive "Any regular additive Haar measure is invariant under negation in an abelian group."]
instance (priority := 100) IsHaarMeasure.isInvInvariant_of_innerRegular
    [LocallyCompactSpace G] [InnerRegular μ] : IsInvInvariant μ := by
  -- the image measure is a Haar measure. By uniqueness up to multiplication, it is of the form
  -- `c μ`. Applying again inversion, one gets the measure `c^2 μ`. But since inversion is an
  -- involution, this is also `μ`. Hence, `c^2 = 1`, which implies `c = 1`.
  constructor
  have : IsHaarMeasure μ.inv := (MulEquiv.inv G).isHaarMeasure_map μ continuous_inv continuous_inv
  obtain ⟨c, _, _, hc⟩ : ∃ c : ℝ≥0∞, c ≠ 0 ∧ c ≠ ∞ ∧ μ.inv = c • μ :=
    isHaarMeasure_eq_smul_of_innerRegular _ _
  have : map Inv.inv (map Inv.inv μ) = c ^ 2 • μ := by
    rw [← inv_def μ, hc, Measure.map_smul, ← inv_def μ, hc, smul_smul, pow_two]
  have μeq : μ = c ^ 2 • μ := by
    rw [map_map continuous_inv.measurable continuous_inv.measurable] at this
    simpa only [inv_involutive, Involutive.comp_self, Measure.map_id]
  have K : PositiveCompacts G := Classical.arbitrary _
  

Proof state:
case inv_eq_self.intro.intro.intro
G : Type u_1
inst✝⁷ : CommGroup G
inst✝⁶ : TopologicalSpace G
inst✝⁵ : TopologicalGroup G
inst✝⁴ : MeasurableSpace G
inst✝³ : BorelSpace G
μ : Measure G
inst✝² : IsHaarMeasure μ
inst✝¹ : LocallyCompactSpace G
inst✝ : InnerRegular μ
this✝ : IsHaarMeasure (Measure.inv μ)
c : ℝ≥0∞
left✝¹ : c ≠ 0
left✝ : c ≠ ⊤
hc : Measure.inv μ = c • μ
this : map Inv.inv (map Inv.inv μ) = c ^ 2 • μ
μeq : μ = c ^ 2 • μ
K : PositiveCompacts G
⊢ Measure.inv μ = μ

Next tactic:
have : c ^ 2 * μ K = 1 ^ 2 * μ K := by
    conv_rhs => rw [μeq]
    simp
/-- Any inner regular Haar measure is invariant under inversion in an abelian group. -/
@[to_additive "Any regular additive Haar measure is invariant under negation in an abelian group."]
instance (priority := 100) IsHaarMeasure.isInvInvariant_of_innerRegular
    [LocallyCompactSpace G] [InnerRegular μ] : IsInvInvariant μ := by
  -- the image measure is a Haar measure. By uniqueness up to multiplication, it is of the form
  -- `c μ`. Applying again inversion, one gets the measure `c^2 μ`. But since inversion is an
  -- involution, this is also `μ`. Hence, `c^2 = 1`, which implies `c = 1`.
  constructor
  have : IsHaarMeasure μ.inv := (MulEquiv.inv G).isHaarMeasure_map μ continuous_inv continuous_inv
  obtain ⟨c, _, _, hc⟩ : ∃ c : ℝ≥0∞, c ≠ 0 ∧ c ≠ ∞ ∧ μ.inv = c • μ :=
    isHaarMeasure_eq_smul_of_innerRegular _ _
  have : map Inv.inv (map Inv.inv μ) = c ^ 2 • μ := by
    rw [← inv_def μ, hc, Measure.map_smul, ← inv_def μ, hc, smul_smul, pow_two]
  have μeq : μ = c ^ 2 • μ := by
    rw [map_map continuous_inv.measurable continuous_inv.measurable] at this
    simpa only [inv_involutive, Involutive.comp_self, Measure.map_id]
  have K : PositiveCompacts G := Classical.arbitrary _
  have : c ^ 2 * μ K = 1 ^ 2 * μ K := by
    

Proof state:
G : Type u_1
inst✝⁷ : CommGroup G
inst✝⁶ : TopologicalSpace G
inst✝⁵ : TopologicalGroup G
inst✝⁴ : MeasurableSpace G
inst✝³ : BorelSpace G
μ : Measure G
inst✝² : IsHaarMeasure μ
inst✝¹ : LocallyCompactSpace G
inst✝ : InnerRegular μ
this✝ : IsHaarMeasure (Measure.inv μ)
c : ℝ≥0∞
left✝¹ : c ≠ 0
left✝ : c ≠ ⊤
hc : Measure.inv μ = c • μ
this : map Inv.inv (map Inv.inv μ) = c ^ 2 • μ
μeq : μ = c ^ 2 • μ
K : PositiveCompacts G
⊢ c ^ 2 * ↑↑μ ↑K = 1 ^ 2 * ↑↑μ ↑K

Next tactic:
conv_rhs => rw [μeq]
/-- Any inner regular Haar measure is invariant under inversion in an abelian group. -/
@[to_additive "Any regular additive Haar measure is invariant under negation in an abelian group."]
instance (priority := 100) IsHaarMeasure.isInvInvariant_of_innerRegular
    [LocallyCompactSpace G] [InnerRegular μ] : IsInvInvariant μ := by
  -- the image measure is a Haar measure. By uniqueness up to multiplication, it is of the form
  -- `c μ`. Applying again inversion, one gets the measure `c^2 μ`. But since inversion is an
  -- involution, this is also `μ`. Hence, `c^2 = 1`, which implies `c = 1`.
  constructor
  have : IsHaarMeasure μ.inv := (MulEquiv.inv G).isHaarMeasure_map μ continuous_inv continuous_inv
  obtain ⟨c, _, _, hc⟩ : ∃ c : ℝ≥0∞, c ≠ 0 ∧ c ≠ ∞ ∧ μ.inv = c • μ :=
    isHaarMeasure_eq_smul_of_innerRegular _ _
  have : map Inv.inv (map Inv.inv μ) = c ^ 2 • μ := by
    rw [← inv_def μ, hc, Measure.map_smul, ← inv_def μ, hc, smul_smul, pow_two]
  have μeq : μ = c ^ 2 • μ := by
    rw [map_map continuous_inv.measurable continuous_inv.measurable] at this
    simpa only [inv_involutive, Involutive.comp_self, Measure.map_id]
  have K : PositiveCompacts G := Classical.arbitrary _
  have : c ^ 2 * μ K = 1 ^ 2 * μ K := by
    conv_rhs => 

Proof state:
G : Type u_1
inst✝⁷ : CommGroup G
inst✝⁶ : TopologicalSpace G
inst✝⁵ : TopologicalGroup G
inst✝⁴ : MeasurableSpace G
inst✝³ : BorelSpace G
μ : Measure G
inst✝² : IsHaarMeasure μ
inst✝¹ : LocallyCompactSpace G
inst✝ : InnerRegular μ
this✝ : IsHaarMeasure (Measure.inv μ)
c : ℝ≥0∞
left✝¹ : c ≠ 0
left✝ : c ≠ ⊤
hc : Measure.inv μ = c • μ
this : map Inv.inv (map Inv.inv μ) = c ^ 2 • μ
μeq : μ = c ^ 2 • μ
K : PositiveCompacts G
| 1 ^ 2 * ↑↑μ ↑K

Next tactic:
rw [μeq]
/-- Any inner regular Haar measure is invariant under inversion in an abelian group. -/
@[to_additive "Any regular additive Haar measure is invariant under negation in an abelian group."]
instance (priority := 100) IsHaarMeasure.isInvInvariant_of_innerRegular
    [LocallyCompactSpace G] [InnerRegular μ] : IsInvInvariant μ := by
  -- the image measure is a Haar measure. By uniqueness up to multiplication, it is of the form
  -- `c μ`. Applying again inversion, one gets the measure `c^2 μ`. But since inversion is an
  -- involution, this is also `μ`. Hence, `c^2 = 1`, which implies `c = 1`.
  constructor
  have : IsHaarMeasure μ.inv := (MulEquiv.inv G).isHaarMeasure_map μ continuous_inv continuous_inv
  obtain ⟨c, _, _, hc⟩ : ∃ c : ℝ≥0∞, c ≠ 0 ∧ c ≠ ∞ ∧ μ.inv = c • μ :=
    isHaarMeasure_eq_smul_of_innerRegular _ _
  have : map Inv.inv (map Inv.inv μ) = c ^ 2 • μ := by
    rw [← inv_def μ, hc, Measure.map_smul, ← inv_def μ, hc, smul_smul, pow_two]
  have μeq : μ = c ^ 2 • μ := by
    rw [map_map continuous_inv.measurable continuous_inv.measurable] at this
    simpa only [inv_involutive, Involutive.comp_self, Measure.map_id]
  have K : PositiveCompacts G := Classical.arbitrary _
  have : c ^ 2 * μ K = 1 ^ 2 * μ K := by
    conv_rhs => rw [μeq]
    

Proof state:
G : Type u_1
inst✝⁷ : CommGroup G
inst✝⁶ : TopologicalSpace G
inst✝⁵ : TopologicalGroup G
inst✝⁴ : MeasurableSpace G
inst✝³ : BorelSpace G
μ : Measure G
inst✝² : IsHaarMeasure μ
inst✝¹ : LocallyCompactSpace G
inst✝ : InnerRegular μ
this✝ : IsHaarMeasure (Measure.inv μ)
c : ℝ≥0∞
left✝¹ : c ≠ 0
left✝ : c ≠ ⊤
hc : Measure.inv μ = c • μ
this : map Inv.inv (map Inv.inv μ) = c ^ 2 • μ
μeq : μ = c ^ 2 • μ
K : PositiveCompacts G
⊢ c ^ 2 * ↑↑μ ↑K = 1 ^ 2 * ↑↑(c ^ 2 • μ) ↑K

Next tactic:
simp
/-- Any inner regular Haar measure is invariant under inversion in an abelian group. -/
@[to_additive "Any regular additive Haar measure is invariant under negation in an abelian group."]
instance (priority := 100) IsHaarMeasure.isInvInvariant_of_innerRegular
    [LocallyCompactSpace G] [InnerRegular μ] : IsInvInvariant μ := by
  -- the image measure is a Haar measure. By uniqueness up to multiplication, it is of the form
  -- `c μ`. Applying again inversion, one gets the measure `c^2 μ`. But since inversion is an
  -- involution, this is also `μ`. Hence, `c^2 = 1`, which implies `c = 1`.
  constructor
  have : IsHaarMeasure μ.inv := (MulEquiv.inv G).isHaarMeasure_map μ continuous_inv continuous_inv
  obtain ⟨c, _, _, hc⟩ : ∃ c : ℝ≥0∞, c ≠ 0 ∧ c ≠ ∞ ∧ μ.inv = c • μ :=
    isHaarMeasure_eq_smul_of_innerRegular _ _
  have : map Inv.inv (map Inv.inv μ) = c ^ 2 • μ := by
    rw [← inv_def μ, hc, Measure.map_smul, ← inv_def μ, hc, smul_smul, pow_two]
  have μeq : μ = c ^ 2 • μ := by
    rw [map_map continuous_inv.measurable continuous_inv.measurable] at this
    simpa only [inv_involutive, Involutive.comp_self, Measure.map_id]
  have K : PositiveCompacts G := Classical.arbitrary _
  have : c ^ 2 * μ K = 1 ^ 2 * μ K := by
    conv_rhs => rw [μeq]
    simp
  

Proof state:
case inv_eq_self.intro.intro.intro
G : Type u_1
inst✝⁷ : CommGroup G
inst✝⁶ : TopologicalSpace G
inst✝⁵ : TopologicalGroup G
inst✝⁴ : MeasurableSpace G
inst✝³ : BorelSpace G
μ : Measure G
inst✝² : IsHaarMeasure μ
inst✝¹ : LocallyCompactSpace G
inst✝ : InnerRegular μ
this✝¹ : IsHaarMeasure (Measure.inv μ)
c : ℝ≥0∞
left✝¹ : c ≠ 0
left✝ : c ≠ ⊤
hc : Measure.inv μ = c • μ
this✝ : map Inv.inv (map Inv.inv μ) = c ^ 2 • μ
μeq : μ = c ^ 2 • μ
K : PositiveCompacts G
this : c ^ 2 * ↑↑μ ↑K = 1 ^ 2 * ↑↑μ ↑K
⊢ Measure.inv μ = μ

Next tactic:
have : c ^ 2 = 1 ^ 2 :=
    (ENNReal.mul_eq_mul_right (measure_pos_of_nonempty_interior _ K.interior_nonempty).ne'
          K.isCompact.measure_lt_top.ne).1 this
/-- Any inner regular Haar measure is invariant under inversion in an abelian group. -/
@[to_additive "Any regular additive Haar measure is invariant under negation in an abelian group."]
instance (priority := 100) IsHaarMeasure.isInvInvariant_of_innerRegular
    [LocallyCompactSpace G] [InnerRegular μ] : IsInvInvariant μ := by
  -- the image measure is a Haar measure. By uniqueness up to multiplication, it is of the form
  -- `c μ`. Applying again inversion, one gets the measure `c^2 μ`. But since inversion is an
  -- involution, this is also `μ`. Hence, `c^2 = 1`, which implies `c = 1`.
  constructor
  have : IsHaarMeasure μ.inv := (MulEquiv.inv G).isHaarMeasure_map μ continuous_inv continuous_inv
  obtain ⟨c, _, _, hc⟩ : ∃ c : ℝ≥0∞, c ≠ 0 ∧ c ≠ ∞ ∧ μ.inv = c • μ :=
    isHaarMeasure_eq_smul_of_innerRegular _ _
  have : map Inv.inv (map Inv.inv μ) = c ^ 2 • μ := by
    rw [← inv_def μ, hc, Measure.map_smul, ← inv_def μ, hc, smul_smul, pow_two]
  have μeq : μ = c ^ 2 • μ := by
    rw [map_map continuous_inv.measurable continuous_inv.measurable] at this
    simpa only [inv_involutive, Involutive.comp_self, Measure.map_id]
  have K : PositiveCompacts G := Classical.arbitrary _
  have : c ^ 2 * μ K = 1 ^ 2 * μ K := by
    conv_rhs => rw [μeq]
    simp
  have : c ^ 2 = 1 ^ 2 :=
    (ENNReal.mul_eq_mul_right (measure_pos_of_nonempty_interior _ K.interior_nonempty).ne'
          K.isCompact.measure_lt_top.ne).1 this
  

Proof state:
case inv_eq_self.intro.intro.intro
G : Type u_1
inst✝⁷ : CommGroup G
inst✝⁶ : TopologicalSpace G
inst✝⁵ : TopologicalGroup G
inst✝⁴ : MeasurableSpace G
inst✝³ : BorelSpace G
μ : Measure G
inst✝² : IsHaarMeasure μ
inst✝¹ : LocallyCompactSpace G
inst✝ : InnerRegular μ
this✝² : IsHaarMeasure (Measure.inv μ)
c : ℝ≥0∞
left✝¹ : c ≠ 0
left✝ : c ≠ ⊤
hc : Measure.inv μ = c • μ
this✝¹ : map Inv.inv (map Inv.inv μ) = c ^ 2 • μ
μeq : μ = c ^ 2 • μ
K : PositiveCompacts G
this✝ : c ^ 2 * ↑↑μ ↑K = 1 ^ 2 * ↑↑μ ↑K
this : c ^ 2 = 1 ^ 2
⊢ Measure.inv μ = μ

Next tactic:
have : c = 1 := (ENNReal.pow_strictMono two_ne_zero).injective this
/-- Any inner regular Haar measure is invariant under inversion in an abelian group. -/
@[to_additive "Any regular additive Haar measure is invariant under negation in an abelian group."]
instance (priority := 100) IsHaarMeasure.isInvInvariant_of_innerRegular
    [LocallyCompactSpace G] [InnerRegular μ] : IsInvInvariant μ := by
  -- the image measure is a Haar measure. By uniqueness up to multiplication, it is of the form
  -- `c μ`. Applying again inversion, one gets the measure `c^2 μ`. But since inversion is an
  -- involution, this is also `μ`. Hence, `c^2 = 1`, which implies `c = 1`.
  constructor
  have : IsHaarMeasure μ.inv := (MulEquiv.inv G).isHaarMeasure_map μ continuous_inv continuous_inv
  obtain ⟨c, _, _, hc⟩ : ∃ c : ℝ≥0∞, c ≠ 0 ∧ c ≠ ∞ ∧ μ.inv = c • μ :=
    isHaarMeasure_eq_smul_of_innerRegular _ _
  have : map Inv.inv (map Inv.inv μ) = c ^ 2 • μ := by
    rw [← inv_def μ, hc, Measure.map_smul, ← inv_def μ, hc, smul_smul, pow_two]
  have μeq : μ = c ^ 2 • μ := by
    rw [map_map continuous_inv.measurable continuous_inv.measurable] at this
    simpa only [inv_involutive, Involutive.comp_self, Measure.map_id]
  have K : PositiveCompacts G := Classical.arbitrary _
  have : c ^ 2 * μ K = 1 ^ 2 * μ K := by
    conv_rhs => rw [μeq]
    simp
  have : c ^ 2 = 1 ^ 2 :=
    (ENNReal.mul_eq_mul_right (measure_pos_of_nonempty_interior _ K.interior_nonempty).ne'
          K.isCompact.measure_lt_top.ne).1 this
  have : c = 1 := (ENNReal.pow_strictMono two_ne_zero).injective this
  

Proof state:
case inv_eq_self.intro.intro.intro
G : Type u_1
inst✝⁷ : CommGroup G
inst✝⁶ : TopologicalSpace G
inst✝⁵ : TopologicalGroup G
inst✝⁴ : MeasurableSpace G
inst✝³ : BorelSpace G
μ : Measure G
inst✝² : IsHaarMeasure μ
inst✝¹ : LocallyCompactSpace G
inst✝ : InnerRegular μ
this✝³ : IsHaarMeasure (Measure.inv μ)
c : ℝ≥0∞
left✝¹ : c ≠ 0
left✝ : c ≠ ⊤
hc : Measure.inv μ = c • μ
this✝² : map Inv.inv (map Inv.inv μ) = c ^ 2 • μ
μeq : μ = c ^ 2 • μ
K : PositiveCompacts G
this✝¹ : c ^ 2 * ↑↑μ ↑K = 1 ^ 2 * ↑↑μ ↑K
this✝ : c ^ 2 = 1 ^ 2
this : c = 1
⊢ Measure.inv μ = μ

Next tactic:
rw [hc, this, one_smul]
@[to_additive]
theorem measurePreserving_zpow [CompactSpace G] [RootableBy G ℤ]
    [InnerRegularCompactLTTop μ] {n : ℤ} (hn : n ≠ 0) :
    MeasurePreserving (fun g : G => g ^ n) μ μ :=
  { measurable := (continuous_zpow n).measurable
    map_eq := by
      

Proof state:
G : Type u_1
inst✝⁸ : CommGroup G
inst✝⁷ : TopologicalSpace G
inst✝⁶ : TopologicalGroup G
inst✝⁵ : MeasurableSpace G
inst✝⁴ : BorelSpace G
μ : Measure G
inst✝³ : IsHaarMeasure μ
inst✝² : CompactSpace G
inst✝¹ : RootableBy G ℤ
inst✝ : InnerRegularCompactLTTop μ
n : ℤ
hn : n ≠ 0
⊢ map (fun g => g ^ n) μ = μ

Next tactic:
let f := @zpowGroupHom G _ n
@[to_additive]
theorem measurePreserving_zpow [CompactSpace G] [RootableBy G ℤ]
    [InnerRegularCompactLTTop μ] {n : ℤ} (hn : n ≠ 0) :
    MeasurePreserving (fun g : G => g ^ n) μ μ :=
  { measurable := (continuous_zpow n).measurable
    map_eq := by
      let f := @zpowGroupHom G _ n
      

Proof state:
G : Type u_1
inst✝⁸ : CommGroup G
inst✝⁷ : TopologicalSpace G
inst✝⁶ : TopologicalGroup G
inst✝⁵ : MeasurableSpace G
inst✝⁴ : BorelSpace G
μ : Measure G
inst✝³ : IsHaarMeasure μ
inst✝² : CompactSpace G
inst✝¹ : RootableBy G ℤ
inst✝ : InnerRegularCompactLTTop μ
n : ℤ
hn : n ≠ 0
f : G →* G := zpowGroupHom n
⊢ map (fun g => g ^ n) μ = μ

Next tactic:
have hf : Continuous f := continuous_zpow n
@[to_additive]
theorem measurePreserving_zpow [CompactSpace G] [RootableBy G ℤ]
    [InnerRegularCompactLTTop μ] {n : ℤ} (hn : n ≠ 0) :
    MeasurePreserving (fun g : G => g ^ n) μ μ :=
  { measurable := (continuous_zpow n).measurable
    map_eq := by
      let f := @zpowGroupHom G _ n
      have hf : Continuous f := continuous_zpow n
      

Proof state:
G : Type u_1
inst✝⁸ : CommGroup G
inst✝⁷ : TopologicalSpace G
inst✝⁶ : TopologicalGroup G
inst✝⁵ : MeasurableSpace G
inst✝⁴ : BorelSpace G
μ : Measure G
inst✝³ : IsHaarMeasure μ
inst✝² : CompactSpace G
inst✝¹ : RootableBy G ℤ
inst✝ : InnerRegularCompactLTTop μ
n : ℤ
hn : n ≠ 0
f : G →* G := zpowGroupHom n
hf : Continuous ⇑f
⊢ map (fun g => g ^ n) μ = μ

Next tactic:
have : (μ.map f).IsHaarMeasure :=
        isHaarMeasure_map_of_isFiniteMeasure μ f hf (RootableBy.surjective_pow G ℤ hn)
@[to_additive]
theorem measurePreserving_zpow [CompactSpace G] [RootableBy G ℤ]
    [InnerRegularCompactLTTop μ] {n : ℤ} (hn : n ≠ 0) :
    MeasurePreserving (fun g : G => g ^ n) μ μ :=
  { measurable := (continuous_zpow n).measurable
    map_eq := by
      let f := @zpowGroupHom G _ n
      have hf : Continuous f := continuous_zpow n
      have : (μ.map f).IsHaarMeasure :=
        isHaarMeasure_map_of_isFiniteMeasure μ f hf (RootableBy.surjective_pow G ℤ hn)
      

Proof state:
G : Type u_1
inst✝⁸ : CommGroup G
inst✝⁷ : TopologicalSpace G
inst✝⁶ : TopologicalGroup G
inst✝⁵ : MeasurableSpace G
inst✝⁴ : BorelSpace G
μ : Measure G
inst✝³ : IsHaarMeasure μ
inst✝² : CompactSpace G
inst✝¹ : RootableBy G ℤ
inst✝ : InnerRegularCompactLTTop μ
n : ℤ
hn : n ≠ 0
f : G →* G := zpowGroupHom n
hf : Continuous ⇑f
this : IsHaarMeasure (map (⇑f) μ)
⊢ map (fun g => g ^ n) μ = μ

Next tactic:
have : InnerRegular (μ.map f) := InnerRegular.map_of_continuous hf