l3lab/ntp-mathlib huggingface dataset:
lemma LieModule.dualAnnihilator_ker_traceForm_le_span_weight [LieAlgebra.IsNilpotent K L]
    [LinearWeights K L M] [IsTriangularizable K L M] [FiniteDimensional K L] :
    (LinearMap.ker (traceForm K L M)).dualAnnihilator ≤ span K (range (weight.toLinear K L M)) := by
  intro g hg
  simp only [Submodule.mem_dualAnnihilator, LinearMap.mem_ker] at hg
  by_contra contra
  obtain ⟨f : Module.Dual K (Module.Dual K L), hf, hf'⟩ :=
    Submodule.exists_dual_map_eq_bot_of_nmem contra inferInstance
  let x : L := (Module.evalEquiv K L).symm f
  replace hf' : ∀ χ ∈ weight K L M, χ x = 0 := by
    intro χ hχ
    change weight.toLinear K L M ⟨χ, hχ⟩ x = 0
    rw [Module.apply_evalEquiv_symm_apply, ← Submodule.mem_bot (R := K), ← hf', Submodule.mem_map]
    exact ⟨weight.toLinear K L M ⟨χ, hχ⟩, Submodule.subset_span (mem_range_self _), rfl⟩
  have hx : g x ≠ 0 := by simpa
  

Proof state:
case intro.intro
R : Type u_1
K : Type u_2
L : Type u_3
M : Type u_4
inst✝¹⁷ : CommRing R
inst✝¹⁶ : LieRing L
inst✝¹⁵ : LieAlgebra R L
inst✝¹⁴ : AddCommGroup M
inst✝¹³ : Module R M
inst✝¹² : LieRingModule L M
inst✝¹¹ : LieModule R L M
inst✝¹⁰ : Module.Free R M
inst✝⁹ : Module.Finite R M
inst✝⁸ : Field K
inst✝⁷ : LieAlgebra K L
inst✝⁶ : Module K M
inst✝⁵ : LieModule K L M
inst✝⁴ : FiniteDimensional K M
inst✝³ : LieAlgebra.IsNilpotent K L
inst✝² : LinearWeights K L M
inst✝¹ : IsTriangularizable K L M
inst✝ : FiniteDimensional K L
g : Module.Dual K L
hg : ∀ (w : L), (traceForm K L M) w = 0 → g w = 0
contra : g ∉ span K (range (weight.toLinear K L M))
f : Module.Dual K (Module.Dual K L)
hf : f g ≠ 0
x : L := (LinearEquiv.symm (Module.evalEquiv K L)) f
hf' : ∀ χ ∈ weight K L M, χ x = 0
hx : g x ≠ 0
⊢ False

Next tactic:
refine hx (hg _ ?_)
lemma LieModule.dualAnnihilator_ker_traceForm_le_span_weight [LieAlgebra.IsNilpotent K L]
    [LinearWeights K L M] [IsTriangularizable K L M] [FiniteDimensional K L] :
    (LinearMap.ker (traceForm K L M)).dualAnnihilator ≤ span K (range (weight.toLinear K L M)) := by
  intro g hg
  simp only [Submodule.mem_dualAnnihilator, LinearMap.mem_ker] at hg
  by_contra contra
  obtain ⟨f : Module.Dual K (Module.Dual K L), hf, hf'⟩ :=
    Submodule.exists_dual_map_eq_bot_of_nmem contra inferInstance
  let x : L := (Module.evalEquiv K L).symm f
  replace hf' : ∀ χ ∈ weight K L M, χ x = 0 := by
    intro χ hχ
    change weight.toLinear K L M ⟨χ, hχ⟩ x = 0
    rw [Module.apply_evalEquiv_symm_apply, ← Submodule.mem_bot (R := K), ← hf', Submodule.mem_map]
    exact ⟨weight.toLinear K L M ⟨χ, hχ⟩, Submodule.subset_span (mem_range_self _), rfl⟩
  have hx : g x ≠ 0 := by simpa
  refine hx (hg _ ?_)
  

Proof state:
case intro.intro
R : Type u_1
K : Type u_2
L : Type u_3
M : Type u_4
inst✝¹⁷ : CommRing R
inst✝¹⁶ : LieRing L
inst✝¹⁵ : LieAlgebra R L
inst✝¹⁴ : AddCommGroup M
inst✝¹³ : Module R M
inst✝¹² : LieRingModule L M
inst✝¹¹ : LieModule R L M
inst✝¹⁰ : Module.Free R M
inst✝⁹ : Module.Finite R M
inst✝⁸ : Field K
inst✝⁷ : LieAlgebra K L
inst✝⁶ : Module K M
inst✝⁵ : LieModule K L M
inst✝⁴ : FiniteDimensional K M
inst✝³ : LieAlgebra.IsNilpotent K L
inst✝² : LinearWeights K L M
inst✝¹ : IsTriangularizable K L M
inst✝ : FiniteDimensional K L
g : Module.Dual K L
hg : ∀ (w : L), (traceForm K L M) w = 0 → g w = 0
contra : g ∉ span K (range (weight.toLinear K L M))
f : Module.Dual K (Module.Dual K L)
hf : f g ≠ 0
x : L := (LinearEquiv.symm (Module.evalEquiv K L)) f
hf' : ∀ χ ∈ weight K L M, χ x = 0
hx : g x ≠ 0
⊢ (traceForm K L M) x = 0

Next tactic:
ext y
lemma LieModule.dualAnnihilator_ker_traceForm_le_span_weight [LieAlgebra.IsNilpotent K L]
    [LinearWeights K L M] [IsTriangularizable K L M] [FiniteDimensional K L] :
    (LinearMap.ker (traceForm K L M)).dualAnnihilator ≤ span K (range (weight.toLinear K L M)) := by
  intro g hg
  simp only [Submodule.mem_dualAnnihilator, LinearMap.mem_ker] at hg
  by_contra contra
  obtain ⟨f : Module.Dual K (Module.Dual K L), hf, hf'⟩ :=
    Submodule.exists_dual_map_eq_bot_of_nmem contra inferInstance
  let x : L := (Module.evalEquiv K L).symm f
  replace hf' : ∀ χ ∈ weight K L M, χ x = 0 := by
    intro χ hχ
    change weight.toLinear K L M ⟨χ, hχ⟩ x = 0
    rw [Module.apply_evalEquiv_symm_apply, ← Submodule.mem_bot (R := K), ← hf', Submodule.mem_map]
    exact ⟨weight.toLinear K L M ⟨χ, hχ⟩, Submodule.subset_span (mem_range_self _), rfl⟩
  have hx : g x ≠ 0 := by simpa
  refine hx (hg _ ?_)
  ext y
  

Proof state:
case intro.intro.h
R : Type u_1
K : Type u_2
L : Type u_3
M : Type u_4
inst✝¹⁷ : CommRing R
inst✝¹⁶ : LieRing L
inst✝¹⁵ : LieAlgebra R L
inst✝¹⁴ : AddCommGroup M
inst✝¹³ : Module R M
inst✝¹² : LieRingModule L M
inst✝¹¹ : LieModule R L M
inst✝¹⁰ : Module.Free R M
inst✝⁹ : Module.Finite R M
inst✝⁸ : Field K
inst✝⁷ : LieAlgebra K L
inst✝⁶ : Module K M
inst✝⁵ : LieModule K L M
inst✝⁴ : FiniteDimensional K M
inst✝³ : LieAlgebra.IsNilpotent K L
inst✝² : LinearWeights K L M
inst✝¹ : IsTriangularizable K L M
inst✝ : FiniteDimensional K L
g : Module.Dual K L
hg : ∀ (w : L), (traceForm K L M) w = 0 → g w = 0
contra : g ∉ span K (range (weight.toLinear K L M))
f : Module.Dual K (Module.Dual K L)
hf : f g ≠ 0
x : L := (LinearEquiv.symm (Module.evalEquiv K L)) f
hf' : ∀ χ ∈ weight K L M, χ x = 0
hx : g x ≠ 0
y : L
⊢ ((traceForm K L M) x) y = 0 y

Next tactic:
rw [LieModule.traceForm_eq_sum_finrank_nsmul_mul, LinearMap.zero_apply]
lemma LieModule.dualAnnihilator_ker_traceForm_le_span_weight [LieAlgebra.IsNilpotent K L]
    [LinearWeights K L M] [IsTriangularizable K L M] [FiniteDimensional K L] :
    (LinearMap.ker (traceForm K L M)).dualAnnihilator ≤ span K (range (weight.toLinear K L M)) := by
  intro g hg
  simp only [Submodule.mem_dualAnnihilator, LinearMap.mem_ker] at hg
  by_contra contra
  obtain ⟨f : Module.Dual K (Module.Dual K L), hf, hf'⟩ :=
    Submodule.exists_dual_map_eq_bot_of_nmem contra inferInstance
  let x : L := (Module.evalEquiv K L).symm f
  replace hf' : ∀ χ ∈ weight K L M, χ x = 0 := by
    intro χ hχ
    change weight.toLinear K L M ⟨χ, hχ⟩ x = 0
    rw [Module.apply_evalEquiv_symm_apply, ← Submodule.mem_bot (R := K), ← hf', Submodule.mem_map]
    exact ⟨weight.toLinear K L M ⟨χ, hχ⟩, Submodule.subset_span (mem_range_self _), rfl⟩
  have hx : g x ≠ 0 := by simpa
  refine hx (hg _ ?_)
  ext y
  rw [LieModule.traceForm_eq_sum_finrank_nsmul_mul, LinearMap.zero_apply]
  

Proof state:
case intro.intro.h
R : Type u_1
K : Type u_2
L : Type u_3
M : Type u_4
inst✝¹⁷ : CommRing R
inst✝¹⁶ : LieRing L
inst✝¹⁵ : LieAlgebra R L
inst✝¹⁴ : AddCommGroup M
inst✝¹³ : Module R M
inst✝¹² : LieRingModule L M
inst✝¹¹ : LieModule R L M
inst✝¹⁰ : Module.Free R M
inst✝⁹ : Module.Finite R M
inst✝⁸ : Field K
inst✝⁷ : LieAlgebra K L
inst✝⁶ : Module K M
inst✝⁵ : LieModule K L M
inst✝⁴ : FiniteDimensional K M
inst✝³ : LieAlgebra.IsNilpotent K L
inst✝² : LinearWeights K L M
inst✝¹ : IsTriangularizable K L M
inst✝ : FiniteDimensional K L
g : Module.Dual K L
hg : ∀ (w : L), (traceForm K L M) w = 0 → g w = 0
contra : g ∉ span K (range (weight.toLinear K L M))
f : Module.Dual K (Module.Dual K L)
hf : f g ≠ 0
x : L := (LinearEquiv.symm (Module.evalEquiv K L)) f
hf' : ∀ χ ∈ weight K L M, χ x = 0
hx : g x ≠ 0
y : L
⊢ ∑ χ in weight K L M, finrank K ↥↑(weightSpace M χ) • (χ x * χ y) = 0

Next tactic:
exact Finset.sum_eq_zero fun χ hχ ↦ by simp [hf' χ hχ]
lemma LieModule.dualAnnihilator_ker_traceForm_le_span_weight [LieAlgebra.IsNilpotent K L]
    [LinearWeights K L M] [IsTriangularizable K L M] [FiniteDimensional K L] :
    (LinearMap.ker (traceForm K L M)).dualAnnihilator ≤ span K (range (weight.toLinear K L M)) := by
  intro g hg
  simp only [Submodule.mem_dualAnnihilator, LinearMap.mem_ker] at hg
  by_contra contra
  obtain ⟨f : Module.Dual K (Module.Dual K L), hf, hf'⟩ :=
    Submodule.exists_dual_map_eq_bot_of_nmem contra inferInstance
  let x : L := (Module.evalEquiv K L).symm f
  replace hf' : ∀ χ ∈ weight K L M, χ x = 0 := by
    intro χ hχ
    change weight.toLinear K L M ⟨χ, hχ⟩ x = 0
    rw [Module.apply_evalEquiv_symm_apply, ← Submodule.mem_bot (R := K), ← hf', Submodule.mem_map]
    exact ⟨weight.toLinear K L M ⟨χ, hχ⟩, Submodule.subset_span (mem_range_self _), rfl⟩
  have hx : g x ≠ 0 := by simpa
  refine hx (hg _ ?_)
  ext y
  rw [LieModule.traceForm_eq_sum_finrank_nsmul_mul, LinearMap.zero_apply]
  exact Finset.sum_eq_zero fun χ hχ ↦ by 

Proof state:
R : Type u_1
K : Type u_2
L : Type u_3
M : Type u_4
inst✝¹⁷ : CommRing R
inst✝¹⁶ : LieRing L
inst✝¹⁵ : LieAlgebra R L
inst✝¹⁴ : AddCommGroup M
inst✝¹³ : Module R M
inst✝¹² : LieRingModule L M
inst✝¹¹ : LieModule R L M
inst✝¹⁰ : Module.Free R M
inst✝⁹ : Module.Finite R M
inst✝⁸ : Field K
inst✝⁷ : LieAlgebra K L
inst✝⁶ : Module K M
inst✝⁵ : LieModule K L M
inst✝⁴ : FiniteDimensional K M
inst✝³ : LieAlgebra.IsNilpotent K L
inst✝² : LinearWeights K L M
inst✝¹ : IsTriangularizable K L M
inst✝ : FiniteDimensional K L
g : Module.Dual K L
hg : ∀ (w : L), (traceForm K L M) w = 0 → g w = 0
contra : g ∉ span K (range (weight.toLinear K L M))
f : Module.Dual K (Module.Dual K L)
hf : f g ≠ 0
x : L := (LinearEquiv.symm (Module.evalEquiv K L)) f
hf' : ∀ χ ∈ weight K L M, χ x = 0
hx : g x ≠ 0
y : L
χ : L → K
hχ : χ ∈ weight K L M
⊢ finrank K ↥↑(weightSpace M χ) • (χ x * χ y) = 0

Next tactic:
simp [hf' χ hχ]
/-- Given a splitting Cartan subalgebra `H` of a finite-dimensional Lie algebra with non-singular
Killing form, the corresponding roots span the dual space of `H`. -/
@[simp]
lemma LieAlgebra.IsKilling.span_weight_eq_top [FiniteDimensional K L] [IsKilling K L]
    (H : LieSubalgebra K L) [H.IsCartanSubalgebra] [IsTriangularizable K H L] :
    span K (range (weight.toLinear K H L)) = ⊤ := by
  

Proof state:
R : Type u_1
K : Type u_2
L : Type u_3
M : Type u_4
inst✝¹⁷ : CommRing R
inst✝¹⁶ : LieRing L
inst✝¹⁵ : LieAlgebra R L
inst✝¹⁴ : AddCommGroup M
inst✝¹³ : Module R M
inst✝¹² : LieRingModule L M
inst✝¹¹ : LieModule R L M
inst✝¹⁰ : Module.Free R M
inst✝⁹ : Module.Finite R M
inst✝⁸ : Field K
inst✝⁷ : LieAlgebra K L
inst✝⁶ : Module K M
inst✝⁵ : LieModule K L M
inst✝⁴ : FiniteDimensional K M
inst✝³ : FiniteDimensional K L
inst✝² : IsKilling K L
H : LieSubalgebra K L
inst✝¹ : LieSubalgebra.IsCartanSubalgebra H
inst✝ : IsTriangularizable K (↥H) L
⊢ span K (range (weight.toLinear K (↥H) L)) = ⊤

Next tactic:
simpa using LieModule.dualAnnihilator_ker_traceForm_le_span_weight K H L
@[to_additive]
theorem measurable_measure_mul_right (hs : MeasurableSet s) :
    Measurable fun x => μ ((fun y => y * x) ⁻¹' s) := by
  

Proof state:
G : Type u_1
inst✝⁴ : MeasurableSpace G
inst✝³ : Group G
inst✝² : MeasurableMul₂ G
μ ν : Measure G
inst✝¹ : SigmaFinite ν
inst✝ : SigmaFinite μ
s : Set G
hs : MeasurableSet s
⊢ Measurable fun x => ↑↑μ ((fun y => y * x) ⁻¹' s)

Next tactic:
suffices
    Measurable fun y =>
      μ ((fun x => (x, y)) ⁻¹' ((fun z : G × G => ((1 : G), z.1 * z.2)) ⁻¹' univ ×ˢ s))
    by convert this using 1; ext1 x; congr 1 with y : 1; simp
@[to_additive]
theorem measurable_measure_mul_right (hs : MeasurableSet s) :
    Measurable fun x => μ ((fun y => y * x) ⁻¹' s) := by
  suffices
    Measurable fun y =>
      μ ((fun x => (x, y)) ⁻¹' ((fun z : G × G => ((1 : G), z.1 * z.2)) ⁻¹' univ ×ˢ s))
    by 

Proof state:
G : Type u_1
inst✝⁴ : MeasurableSpace G
inst✝³ : Group G
inst✝² : MeasurableMul₂ G
μ ν : Measure G
inst✝¹ : SigmaFinite ν
inst✝ : SigmaFinite μ
s : Set G
hs : MeasurableSet s
this : Measurable fun y => ↑↑μ ((fun x => (x, y)) ⁻¹' ((fun z => (1, z.1 * z.2)) ⁻¹' univ ×ˢ s))
⊢ Measurable fun x => ↑↑μ ((fun y => y * x) ⁻¹' s)

Next tactic:
convert this using 1
@[to_additive]
theorem measurable_measure_mul_right (hs : MeasurableSet s) :
    Measurable fun x => μ ((fun y => y * x) ⁻¹' s) := by
  suffices
    Measurable fun y =>
      μ ((fun x => (x, y)) ⁻¹' ((fun z : G × G => ((1 : G), z.1 * z.2)) ⁻¹' univ ×ˢ s))
    by convert this using 1; 

Proof state:
case h.e'_5
G : Type u_1
inst✝⁴ : MeasurableSpace G
inst✝³ : Group G
inst✝² : MeasurableMul₂ G
μ ν : Measure G
inst✝¹ : SigmaFinite ν
inst✝ : SigmaFinite μ
s : Set G
hs : MeasurableSet s
this : Measurable fun y => ↑↑μ ((fun x => (x, y)) ⁻¹' ((fun z => (1, z.1 * z.2)) ⁻¹' univ ×ˢ s))
⊢ (fun x => ↑↑μ ((fun y => y * x) ⁻¹' s)) = fun y =>
    ↑↑μ ((fun x => (x, y)) ⁻¹' ((fun z => (1, z.1 * z.2)) ⁻¹' univ ×ˢ s))

Next tactic:
ext1 x
@[to_additive]
theorem measurable_measure_mul_right (hs : MeasurableSet s) :
    Measurable fun x => μ ((fun y => y * x) ⁻¹' s) := by
  suffices
    Measurable fun y =>
      μ ((fun x => (x, y)) ⁻¹' ((fun z : G × G => ((1 : G), z.1 * z.2)) ⁻¹' univ ×ˢ s))
    by convert this using 1; ext1 x; 

Proof state:
case h.e'_5.h
G : Type u_1
inst✝⁴ : MeasurableSpace G
inst✝³ : Group G
inst✝² : MeasurableMul₂ G
μ ν : Measure G
inst✝¹ : SigmaFinite ν
inst✝ : SigmaFinite μ
s : Set G
hs : MeasurableSet s
this : Measurable fun y => ↑↑μ ((fun x => (x, y)) ⁻¹' ((fun z => (1, z.1 * z.2)) ⁻¹' univ ×ˢ s))
x : G
⊢ ↑↑μ ((fun y => y * x) ⁻¹' s) = ↑↑μ ((fun x_1 => (x_1, x)) ⁻¹' ((fun z => (1, z.1 * z.2)) ⁻¹' univ ×ˢ s))

Next tactic:
congr 1 with y : 1
@[to_additive]
theorem measurable_measure_mul_right (hs : MeasurableSet s) :
    Measurable fun x => μ ((fun y => y * x) ⁻¹' s) := by
  suffices
    Measurable fun y =>
      μ ((fun x => (x, y)) ⁻¹' ((fun z : G × G => ((1 : G), z.1 * z.2)) ⁻¹' univ ×ˢ s))
    by convert this using 1; ext1 x; congr 1 with y : 1; 

Proof state:
case h.e'_5.h.e_a.h
G : Type u_1
inst✝⁴ : MeasurableSpace G
inst✝³ : Group G
inst✝² : MeasurableMul₂ G
μ ν : Measure G
inst✝¹ : SigmaFinite ν
inst✝ : SigmaFinite μ
s : Set G
hs : MeasurableSet s
this : Measurable fun y => ↑↑μ ((fun x => (x, y)) ⁻¹' ((fun z => (1, z.1 * z.2)) ⁻¹' univ ×ˢ s))
x y : G
⊢ y ∈ (fun y => y * x) ⁻¹' s ↔ y ∈ (fun x_1 => (x_1, x)) ⁻¹' ((fun z => (1, z.1 * z.2)) ⁻¹' univ ×ˢ s)

Next tactic:
simp
@[to_additive]
theorem measurable_measure_mul_right (hs : MeasurableSet s) :
    Measurable fun x => μ ((fun y => y * x) ⁻¹' s) := by
  suffices
    Measurable fun y =>
      μ ((fun x => (x, y)) ⁻¹' ((fun z : G × G => ((1 : G), z.1 * z.2)) ⁻¹' univ ×ˢ s))
    by convert this using 1; ext1 x; congr 1 with y : 1; simp
  

Proof state:
G : Type u_1
inst✝⁴ : MeasurableSpace G
inst✝³ : Group G
inst✝² : MeasurableMul₂ G
μ ν : Measure G
inst✝¹ : SigmaFinite ν
inst✝ : SigmaFinite μ
s : Set G
hs : MeasurableSet s
⊢ Measurable fun y => ↑↑μ ((fun x => (x, y)) ⁻¹' ((fun z => (1, z.1 * z.2)) ⁻¹' univ ×ˢ s))

Next tactic:
apply measurable_measure_prod_mk_right
@[to_additive]
theorem measurable_measure_mul_right (hs : MeasurableSet s) :
    Measurable fun x => μ ((fun y => y * x) ⁻¹' s) := by
  suffices
    Measurable fun y =>
      μ ((fun x => (x, y)) ⁻¹' ((fun z : G × G => ((1 : G), z.1 * z.2)) ⁻¹' univ ×ˢ s))
    by convert this using 1; ext1 x; congr 1 with y : 1; simp
  apply measurable_measure_prod_mk_right
  

Proof state:
case hs
G : Type u_1
inst✝⁴ : MeasurableSpace G
inst✝³ : Group G
inst✝² : MeasurableMul₂ G
μ ν : Measure G
inst✝¹ : SigmaFinite ν
inst✝ : SigmaFinite μ
s : Set G
hs : MeasurableSet s
⊢ MeasurableSet ((fun z => (1, z.1 * z.2)) ⁻¹' univ ×ˢ s)

Next tactic:
apply measurable_const.prod_mk measurable_mul (MeasurableSet.univ.prod hs)
@[to_additive]
theorem measurable_measure_mul_right (hs : MeasurableSet s) :
    Measurable fun x => μ ((fun y => y * x) ⁻¹' s) := by
  suffices
    Measurable fun y =>
      μ ((fun x => (x, y)) ⁻¹' ((fun z : G × G => ((1 : G), z.1 * z.2)) ⁻¹' univ ×ˢ s))
    by convert this using 1; ext1 x; congr 1 with y : 1; simp
  apply measurable_measure_prod_mk_right
  apply measurable_const.prod_mk measurable_mul (MeasurableSet.univ.prod hs)
  

Proof state:
G : Type u_1
inst✝⁴ : MeasurableSpace G
inst✝³ : Group G
inst✝² : MeasurableMul₂ G
μ ν : Measure G
inst✝¹ : SigmaFinite ν
inst✝ : SigmaFinite μ
s : Set G
hs : MeasurableSet s
⊢ MeasurableSpace G

Next tactic:
infer_instance
/-- The map `(x, y) ↦ (yx, x⁻¹)` is measure-preserving.
This is the function `S⁻¹RSR` in [Halmos, §59],
where `S` is the map `(x, y) ↦ (x, xy)` and `R` is `Prod.swap`. -/
@[to_additive measurePreserving_add_prod_neg
"The map `(x, y) ↦ (y + x, - x)` is measure-preserving."]
theorem measurePreserving_mul_prod_inv [IsMulLeftInvariant ν] :
    MeasurePreserving (fun z : G × G => (z.2 * z.1, z.1⁻¹)) (μ.prod ν) (μ.prod ν) := by
  

Proof state:
G : Type u_1
inst✝⁷ : MeasurableSpace G
inst✝⁶ : Group G
inst✝⁵ : MeasurableMul₂ G
μ ν : Measure G
inst✝⁴ : SigmaFinite ν
inst✝³ : SigmaFinite μ
s : Set G
inst✝² : MeasurableInv G
inst✝¹ : IsMulLeftInvariant μ
inst✝ : IsMulLeftInvariant ν
⊢ MeasurePreserving fun z => (z.2 * z.1, z.1⁻¹)

Next tactic:
convert (measurePreserving_prod_inv_mul_swap ν μ).comp (measurePreserving_prod_mul_swap μ ν)
    using 1
/-- The map `(x, y) ↦ (yx, x⁻¹)` is measure-preserving.
This is the function `S⁻¹RSR` in [Halmos, §59],
where `S` is the map `(x, y) ↦ (x, xy)` and `R` is `Prod.swap`. -/
@[to_additive measurePreserving_add_prod_neg
"The map `(x, y) ↦ (y + x, - x)` is measure-preserving."]
theorem measurePreserving_mul_prod_inv [IsMulLeftInvariant ν] :
    MeasurePreserving (fun z : G × G => (z.2 * z.1, z.1⁻¹)) (μ.prod ν) (μ.prod ν) := by
  convert (measurePreserving_prod_inv_mul_swap ν μ).comp (measurePreserving_prod_mul_swap μ ν)
    using 1
  

Proof state:
case h.e'_5
G : Type u_1
inst✝⁷ : MeasurableSpace G
inst✝⁶ : Group G
inst✝⁵ : MeasurableMul₂ G
μ ν : Measure G
inst✝⁴ : SigmaFinite ν
inst✝³ : SigmaFinite μ
s : Set G
inst✝² : MeasurableInv G
inst✝¹ : IsMulLeftInvariant μ
inst✝ : IsMulLeftInvariant ν
⊢ (fun z => (z.2 * z.1, z.1⁻¹)) = (fun z => (z.2, z.2⁻¹ * z.1)) ∘ fun z => (z.2, z.2 * z.1)

Next tactic:
ext1 ⟨x, y⟩
/-- The map `(x, y) ↦ (yx, x⁻¹)` is measure-preserving.
This is the function `S⁻¹RSR` in [Halmos, §59],
where `S` is the map `(x, y) ↦ (x, xy)` and `R` is `Prod.swap`. -/
@[to_additive measurePreserving_add_prod_neg
"The map `(x, y) ↦ (y + x, - x)` is measure-preserving."]
theorem measurePreserving_mul_prod_inv [IsMulLeftInvariant ν] :
    MeasurePreserving (fun z : G × G => (z.2 * z.1, z.1⁻¹)) (μ.prod ν) (μ.prod ν) := by
  convert (measurePreserving_prod_inv_mul_swap ν μ).comp (measurePreserving_prod_mul_swap μ ν)
    using 1
  ext1 ⟨x, y⟩
  

Proof state:
case h.e'_5.h.mk
G : Type u_1
inst✝⁷ : MeasurableSpace G
inst✝⁶ : Group G
inst✝⁵ : MeasurableMul₂ G
μ ν : Measure G
inst✝⁴ : SigmaFinite ν
inst✝³ : SigmaFinite μ
s : Set G
inst✝² : MeasurableInv G
inst✝¹ : IsMulLeftInvariant μ
inst✝ : IsMulLeftInvariant ν
x y : G
⊢ ((x, y).2 * (x, y).1, (x, y).1⁻¹) = ((fun z => (z.2, z.2⁻¹ * z.1)) ∘ fun z => (z.2, z.2 * z.1)) (x, y)

Next tactic:
simp_rw [Function.comp_apply, mul_inv_rev, inv_mul_cancel_right]
@[to_additive]
theorem quasiMeasurePreserving_inv : QuasiMeasurePreserving (Inv.inv : G → G) μ μ := by
  

Proof state:
G : Type u_1
inst✝⁶ : MeasurableSpace G
inst✝⁵ : Group G
inst✝⁴ : MeasurableMul₂ G
μ ν : Measure G
inst✝³ : SigmaFinite ν
inst✝² : SigmaFinite μ
s : Set G
inst✝¹ : MeasurableInv G
inst✝ : IsMulLeftInvariant μ
⊢ QuasiMeasurePreserving Inv.inv

Next tactic:
refine' ⟨measurable_inv, AbsolutelyContinuous.mk fun s hsm hμs => _⟩
@[to_additive]
theorem quasiMeasurePreserving_inv : QuasiMeasurePreserving (Inv.inv : G → G) μ μ := by
  refine' ⟨measurable_inv, AbsolutelyContinuous.mk fun s hsm hμs => _⟩
  

Proof state:
G : Type u_1
inst✝⁶ : MeasurableSpace G
inst✝⁵ : Group G
inst✝⁴ : MeasurableMul₂ G
μ ν : Measure G
inst✝³ : SigmaFinite ν
inst✝² : SigmaFinite μ
s✝ : Set G
inst✝¹ : MeasurableInv G
inst✝ : IsMulLeftInvariant μ
s : Set G
hsm : MeasurableSet s
hμs : ↑↑μ s = 0
⊢ ↑↑(map Inv.inv μ) s = 0

Next tactic:
rw [map_apply measurable_inv hsm, inv_preimage]
@[to_additive]
theorem quasiMeasurePreserving_inv : QuasiMeasurePreserving (Inv.inv : G → G) μ μ := by
  refine' ⟨measurable_inv, AbsolutelyContinuous.mk fun s hsm hμs => _⟩
  rw [map_apply measurable_inv hsm, inv_preimage]
  

Proof state:
G : Type u_1
inst✝⁶ : MeasurableSpace G
inst✝⁵ : Group G
inst✝⁴ : MeasurableMul₂ G
μ ν : Measure G
inst✝³ : SigmaFinite ν
inst✝² : SigmaFinite μ
s✝ : Set G
inst✝¹ : MeasurableInv G
inst✝ : IsMulLeftInvariant μ
s : Set G
hsm : MeasurableSet s
hμs : ↑↑μ s = 0
⊢ ↑↑μ s⁻¹ = 0

Next tactic:
have hf : Measurable fun z : G × G => (z.2 * z.1, z.1⁻¹) :=
    (measurable_snd.mul measurable_fst).prod_mk measurable_fst.inv
@[to_additive]
theorem quasiMeasurePreserving_inv : QuasiMeasurePreserving (Inv.inv : G → G) μ μ := by
  refine' ⟨measurable_inv, AbsolutelyContinuous.mk fun s hsm hμs => _⟩
  rw [map_apply measurable_inv hsm, inv_preimage]
  have hf : Measurable fun z : G × G => (z.2 * z.1, z.1⁻¹) :=
    (measurable_snd.mul measurable_fst).prod_mk measurable_fst.inv
  

Proof state:
G : Type u_1
inst✝⁶ : MeasurableSpace G
inst✝⁵ : Group G
inst✝⁴ : MeasurableMul₂ G
μ ν : Measure G
inst✝³ : SigmaFinite ν
inst✝² : SigmaFinite μ
s✝ : Set G
inst✝¹ : MeasurableInv G
inst✝ : IsMulLeftInvariant μ
s : Set G
hsm : MeasurableSet s
hμs : ↑↑μ s = 0
hf : Measurable fun z => (z.2 * z.1, z.1⁻¹)
⊢ ↑↑μ s⁻¹ = 0

Next tactic:
suffices map (fun z : G × G => (z.2 * z.1, z.1⁻¹)) (μ.prod μ) (s⁻¹ ×ˢ s⁻¹) = 0 by
    simpa only [(measurePreserving_mul_prod_inv μ μ).map_eq, prod_prod, mul_eq_zero (M₀ := ℝ≥0∞),
      or_self_iff] using this
@[to_additive]
theorem quasiMeasurePreserving_inv : QuasiMeasurePreserving (Inv.inv : G → G) μ μ := by
  refine' ⟨measurable_inv, AbsolutelyContinuous.mk fun s hsm hμs => _⟩
  rw [map_apply measurable_inv hsm, inv_preimage]
  have hf : Measurable fun z : G × G => (z.2 * z.1, z.1⁻¹) :=
    (measurable_snd.mul measurable_fst).prod_mk measurable_fst.inv
  suffices map (fun z : G × G => (z.2 * z.1, z.1⁻¹)) (μ.prod μ) (s⁻¹ ×ˢ s⁻¹) = 0 by
    

Proof state:
G : Type u_1
inst✝⁶ : MeasurableSpace G
inst✝⁵ : Group G
inst✝⁴ : MeasurableMul₂ G
μ ν : Measure G
inst✝³ : SigmaFinite ν
inst✝² : SigmaFinite μ
s✝ : Set G
inst✝¹ : MeasurableInv G
inst✝ : IsMulLeftInvariant μ
s : Set G
hsm : MeasurableSet s
hμs : ↑↑μ s = 0
hf : Measurable fun z => (z.2 * z.1, z.1⁻¹)
this : ↑↑(map (fun z => (z.2 * z.1, z.1⁻¹)) (Measure.prod μ μ)) (s⁻¹ ×ˢ s⁻¹) = 0
⊢ ↑↑μ s⁻¹ = 0

Next tactic:
simpa only [(measurePreserving_mul_prod_inv μ μ).map_eq, prod_prod, mul_eq_zero (M₀ := ℝ≥0∞),
      or_self_iff] using this
@[to_additive]
theorem quasiMeasurePreserving_inv : QuasiMeasurePreserving (Inv.inv : G → G) μ μ := by
  refine' ⟨measurable_inv, AbsolutelyContinuous.mk fun s hsm hμs => _⟩
  rw [map_apply measurable_inv hsm, inv_preimage]
  have hf : Measurable fun z : G × G => (z.2 * z.1, z.1⁻¹) :=
    (measurable_snd.mul measurable_fst).prod_mk measurable_fst.inv
  suffices map (fun z : G × G => (z.2 * z.1, z.1⁻¹)) (μ.prod μ) (s⁻¹ ×ˢ s⁻¹) = 0 by
    simpa only [(measurePreserving_mul_prod_inv μ μ).map_eq, prod_prod, mul_eq_zero (M₀ := ℝ≥0∞),
      or_self_iff] using this
  

Proof state:
G : Type u_1
inst✝⁶ : MeasurableSpace G
inst✝⁵ : Group G
inst✝⁴ : MeasurableMul₂ G
μ ν : Measure G
inst✝³ : SigmaFinite ν
inst✝² : SigmaFinite μ
s✝ : Set G
inst✝¹ : MeasurableInv G
inst✝ : IsMulLeftInvariant μ
s : Set G
hsm : MeasurableSet s
hμs : ↑↑μ s = 0
hf : Measurable fun z => (z.2 * z.1, z.1⁻¹)
⊢ ↑↑(map (fun z => (z.2 * z.1, z.1⁻¹)) (Measure.prod μ μ)) (s⁻¹ ×ˢ s⁻¹) = 0

Next tactic:
have hsm' : MeasurableSet (s⁻¹ ×ˢ s⁻¹) := hsm.inv.prod hsm.inv
@[to_additive]
theorem quasiMeasurePreserving_inv : QuasiMeasurePreserving (Inv.inv : G → G) μ μ := by
  refine' ⟨measurable_inv, AbsolutelyContinuous.mk fun s hsm hμs => _⟩
  rw [map_apply measurable_inv hsm, inv_preimage]
  have hf : Measurable fun z : G × G => (z.2 * z.1, z.1⁻¹) :=
    (measurable_snd.mul measurable_fst).prod_mk measurable_fst.inv
  suffices map (fun z : G × G => (z.2 * z.1, z.1⁻¹)) (μ.prod μ) (s⁻¹ ×ˢ s⁻¹) = 0 by
    simpa only [(measurePreserving_mul_prod_inv μ μ).map_eq, prod_prod, mul_eq_zero (M₀ := ℝ≥0∞),
      or_self_iff] using this
  have hsm' : MeasurableSet (s⁻¹ ×ˢ s⁻¹) := hsm.inv.prod hsm.inv
  

Proof state:
G : Type u_1
inst✝⁶ : MeasurableSpace G
inst✝⁵ : Group G
inst✝⁴ : MeasurableMul₂ G
μ ν : Measure G
inst✝³ : SigmaFinite ν
inst✝² : SigmaFinite μ
s✝ : Set G
inst✝¹ : MeasurableInv G
inst✝ : IsMulLeftInvariant μ
s : Set G
hsm : MeasurableSet s
hμs : ↑↑μ s = 0
hf : Measurable fun z => (z.2 * z.1, z.1⁻¹)
hsm' : MeasurableSet (s⁻¹ ×ˢ s⁻¹)
⊢ ↑↑(map (fun z => (z.2 * z.1, z.1⁻¹)) (Measure.prod μ μ)) (s⁻¹ ×ˢ s⁻¹) = 0

Next tactic:
simp_rw [map_apply hf hsm', prod_apply_symm (μ := μ) (ν := μ) (hf hsm'), preimage_preimage,
    mk_preimage_prod, inv_preimage, inv_inv, measure_mono_null (inter_subset_right _ _) hμs,
    lintegral_zero]