l3lab/ntp-mathlib huggingface dataset:
/-- This is the **Unfolding Trick**: Given an additive subgroup `Γ'` of an additive group `G'`, the
  integral of a function `f` on `G'` times the lift to `G'` of a function `g` on the quotient
  `G' ⧸ Γ'` with respect to a right-invariant measure `μ` on `G'`, is equal to the integral over
  the quotient of the automorphization of `f` times `g`. -/
lemma QuotientAddGroup.integral_mul_eq_integral_automorphize_mul {K : Type*} [NormedField K]
    [NormedSpace ℝ K] [μ'.IsAddRightInvariant] {f : G' → K}
    (f_ℒ_1 : Integrable f μ') {g : G' ⧸ Γ' → K} (hg : AEStronglyMeasurable g μ_𝓕)
    (g_ℒ_infinity : essSup (fun x ↦ (‖g x‖₊ : ℝ≥0∞)) μ_𝓕 ≠ ∞)
    (F_ae_measurable : AEStronglyMeasurable (QuotientAddGroup.automorphize f) μ_𝓕)
    (h𝓕 : IsAddFundamentalDomain Γ'.op 𝓕' μ') :
    ∫ x : G', g (x : G' ⧸ Γ') * (f x) ∂μ'
      = ∫ x : G' ⧸ Γ', g x * (QuotientAddGroup.automorphize f x) ∂μ_𝓕 := by
  let π : G' → G' ⧸ Γ' := QuotientAddGroup.mk
  have meas_π : Measurable π := continuous_quotient_mk'.measurable
  have H₀ : QuotientAddGroup.automorphize ((g ∘ π) * f) = g * (QuotientAddGroup.automorphize f) :=
    by exact QuotientAddGroup.automorphize_smul_left f g
  calc ∫ (x : G'), g (π x) * f x ∂μ' =
    ∫ (x : G' ⧸ Γ'), QuotientAddGroup.automorphize ((g ∘ π) * f) x ∂μ_𝓕 := ?_
    _ = ∫ (x : G' ⧸ Γ'), g x * (QuotientAddGroup.automorphize f x) ∂μ_𝓕 := by simp [H₀]
  

Proof state:
G : Type u_1
inst✝¹⁸ : Group G
inst✝¹⁷ : MeasurableSpace G
inst✝¹⁶ : TopologicalSpace G
inst✝¹⁵ : TopologicalGroup G
inst✝¹⁴ : BorelSpace G
μ : Measure G
Γ : Subgroup G
𝓕 : Set G
h𝓕✝ : IsFundamentalDomain (↥(Subgroup.op Γ)) 𝓕
inst✝¹³ : Countable ↥Γ
inst✝¹² : MeasurableSpace (G ⧸ Γ)
inst✝¹¹ : BorelSpace (G ⧸ Γ)
G' : Type u_2
inst✝¹⁰ : AddGroup G'
inst✝⁹ : MeasurableSpace G'
inst✝⁸ : TopologicalSpace G'
inst✝⁷ : TopologicalAddGroup G'
inst✝⁶ : BorelSpace G'
μ' : Measure G'
Γ' : AddSubgroup G'
inst✝⁵ : Countable ↥Γ'
inst✝⁴ : MeasurableSpace (G' ⧸ Γ')
inst✝³ : BorelSpace (G' ⧸ Γ')
𝓕' : Set G'
K : Type u_3
inst✝² : NormedField K
inst✝¹ : NormedSpace ℝ K
inst✝ : IsAddRightInvariant μ'
f : G' → K
f_ℒ_1 : Integrable f
g : G' ⧸ Γ' → K
hg : AEStronglyMeasurable g (Measure.map mk (Measure.restrict μ' 𝓕'))
g_ℒ_infinity : essSup (fun x => ↑‖g x‖₊) (Measure.map mk (Measure.restrict μ' 𝓕')) ≠ ⊤
F_ae_measurable : AEStronglyMeasurable (automorphize f) (Measure.map mk (Measure.restrict μ' 𝓕'))
h𝓕 : IsAddFundamentalDomain (↥(AddSubgroup.op Γ')) 𝓕'
π : G' → G' ⧸ Γ' := mk
meas_π : Measurable π
H₀ : automorphize (g ∘ π * f) = g * automorphize f
⊢ ∫ (x : G'), g (π x) * f x ∂μ' = ∫ (x : G' ⧸ Γ'), automorphize (g ∘ π * f) x ∂Measure.map mk (Measure.restrict μ' 𝓕')

Next tactic:
have H₁ : Integrable ((g ∘ π) * f) μ'
/-- This is the **Unfolding Trick**: Given an additive subgroup `Γ'` of an additive group `G'`, the
  integral of a function `f` on `G'` times the lift to `G'` of a function `g` on the quotient
  `G' ⧸ Γ'` with respect to a right-invariant measure `μ` on `G'`, is equal to the integral over
  the quotient of the automorphization of `f` times `g`. -/
lemma QuotientAddGroup.integral_mul_eq_integral_automorphize_mul {K : Type*} [NormedField K]
    [NormedSpace ℝ K] [μ'.IsAddRightInvariant] {f : G' → K}
    (f_ℒ_1 : Integrable f μ') {g : G' ⧸ Γ' → K} (hg : AEStronglyMeasurable g μ_𝓕)
    (g_ℒ_infinity : essSup (fun x ↦ (‖g x‖₊ : ℝ≥0∞)) μ_𝓕 ≠ ∞)
    (F_ae_measurable : AEStronglyMeasurable (QuotientAddGroup.automorphize f) μ_𝓕)
    (h𝓕 : IsAddFundamentalDomain Γ'.op 𝓕' μ') :
    ∫ x : G', g (x : G' ⧸ Γ') * (f x) ∂μ'
      = ∫ x : G' ⧸ Γ', g x * (QuotientAddGroup.automorphize f x) ∂μ_𝓕 := by
  let π : G' → G' ⧸ Γ' := QuotientAddGroup.mk
  have meas_π : Measurable π := continuous_quotient_mk'.measurable
  have H₀ : QuotientAddGroup.automorphize ((g ∘ π) * f) = g * (QuotientAddGroup.automorphize f) :=
    by exact QuotientAddGroup.automorphize_smul_left f g
  calc ∫ (x : G'), g (π x) * f x ∂μ' =
    ∫ (x : G' ⧸ Γ'), QuotientAddGroup.automorphize ((g ∘ π) * f) x ∂μ_𝓕 := ?_
    _ = ∫ (x : G' ⧸ Γ'), g x * (QuotientAddGroup.automorphize f x) ∂μ_𝓕 := by simp [H₀]
  have H₁ : Integrable ((g ∘ π) * f) μ'
  · 

Proof state:
case H₁
G : Type u_1
inst✝¹⁸ : Group G
inst✝¹⁷ : MeasurableSpace G
inst✝¹⁶ : TopologicalSpace G
inst✝¹⁵ : TopologicalGroup G
inst✝¹⁴ : BorelSpace G
μ : Measure G
Γ : Subgroup G
𝓕 : Set G
h𝓕✝ : IsFundamentalDomain (↥(Subgroup.op Γ)) 𝓕
inst✝¹³ : Countable ↥Γ
inst✝¹² : MeasurableSpace (G ⧸ Γ)
inst✝¹¹ : BorelSpace (G ⧸ Γ)
G' : Type u_2
inst✝¹⁰ : AddGroup G'
inst✝⁹ : MeasurableSpace G'
inst✝⁸ : TopologicalSpace G'
inst✝⁷ : TopologicalAddGroup G'
inst✝⁶ : BorelSpace G'
μ' : Measure G'
Γ' : AddSubgroup G'
inst✝⁵ : Countable ↥Γ'
inst✝⁴ : MeasurableSpace (G' ⧸ Γ')
inst✝³ : BorelSpace (G' ⧸ Γ')
𝓕' : Set G'
K : Type u_3
inst✝² : NormedField K
inst✝¹ : NormedSpace ℝ K
inst✝ : IsAddRightInvariant μ'
f : G' → K
f_ℒ_1 : Integrable f
g : G' ⧸ Γ' → K
hg : AEStronglyMeasurable g (Measure.map mk (Measure.restrict μ' 𝓕'))
g_ℒ_infinity : essSup (fun x => ↑‖g x‖₊) (Measure.map mk (Measure.restrict μ' 𝓕')) ≠ ⊤
F_ae_measurable : AEStronglyMeasurable (automorphize f) (Measure.map mk (Measure.restrict μ' 𝓕'))
h𝓕 : IsAddFundamentalDomain (↥(AddSubgroup.op Γ')) 𝓕'
π : G' → G' ⧸ Γ' := mk
meas_π : Measurable π
H₀ : automorphize (g ∘ π * f) = g * automorphize f
⊢ Integrable (g ∘ π * f)

Next tactic:
have : AEStronglyMeasurable (fun (x : G') ↦ g (x : (G' ⧸ Γ'))) μ'
/-- This is the **Unfolding Trick**: Given an additive subgroup `Γ'` of an additive group `G'`, the
  integral of a function `f` on `G'` times the lift to `G'` of a function `g` on the quotient
  `G' ⧸ Γ'` with respect to a right-invariant measure `μ` on `G'`, is equal to the integral over
  the quotient of the automorphization of `f` times `g`. -/
lemma QuotientAddGroup.integral_mul_eq_integral_automorphize_mul {K : Type*} [NormedField K]
    [NormedSpace ℝ K] [μ'.IsAddRightInvariant] {f : G' → K}
    (f_ℒ_1 : Integrable f μ') {g : G' ⧸ Γ' → K} (hg : AEStronglyMeasurable g μ_𝓕)
    (g_ℒ_infinity : essSup (fun x ↦ (‖g x‖₊ : ℝ≥0∞)) μ_𝓕 ≠ ∞)
    (F_ae_measurable : AEStronglyMeasurable (QuotientAddGroup.automorphize f) μ_𝓕)
    (h𝓕 : IsAddFundamentalDomain Γ'.op 𝓕' μ') :
    ∫ x : G', g (x : G' ⧸ Γ') * (f x) ∂μ'
      = ∫ x : G' ⧸ Γ', g x * (QuotientAddGroup.automorphize f x) ∂μ_𝓕 := by
  let π : G' → G' ⧸ Γ' := QuotientAddGroup.mk
  have meas_π : Measurable π := continuous_quotient_mk'.measurable
  have H₀ : QuotientAddGroup.automorphize ((g ∘ π) * f) = g * (QuotientAddGroup.automorphize f) :=
    by exact QuotientAddGroup.automorphize_smul_left f g
  calc ∫ (x : G'), g (π x) * f x ∂μ' =
    ∫ (x : G' ⧸ Γ'), QuotientAddGroup.automorphize ((g ∘ π) * f) x ∂μ_𝓕 := ?_
    _ = ∫ (x : G' ⧸ Γ'), g x * (QuotientAddGroup.automorphize f x) ∂μ_𝓕 := by simp [H₀]
  have H₁ : Integrable ((g ∘ π) * f) μ'
  · have : AEStronglyMeasurable (fun (x : G') ↦ g (x : (G' ⧸ Γ'))) μ'
    · 

Proof state:
case this
G : Type u_1
inst✝¹⁸ : Group G
inst✝¹⁷ : MeasurableSpace G
inst✝¹⁶ : TopologicalSpace G
inst✝¹⁵ : TopologicalGroup G
inst✝¹⁴ : BorelSpace G
μ : Measure G
Γ : Subgroup G
𝓕 : Set G
h𝓕✝ : IsFundamentalDomain (↥(Subgroup.op Γ)) 𝓕
inst✝¹³ : Countable ↥Γ
inst✝¹² : MeasurableSpace (G ⧸ Γ)
inst✝¹¹ : BorelSpace (G ⧸ Γ)
G' : Type u_2
inst✝¹⁰ : AddGroup G'
inst✝⁹ : MeasurableSpace G'
inst✝⁸ : TopologicalSpace G'
inst✝⁷ : TopologicalAddGroup G'
inst✝⁶ : BorelSpace G'
μ' : Measure G'
Γ' : AddSubgroup G'
inst✝⁵ : Countable ↥Γ'
inst✝⁴ : MeasurableSpace (G' ⧸ Γ')
inst✝³ : BorelSpace (G' ⧸ Γ')
𝓕' : Set G'
K : Type u_3
inst✝² : NormedField K
inst✝¹ : NormedSpace ℝ K
inst✝ : IsAddRightInvariant μ'
f : G' → K
f_ℒ_1 : Integrable f
g : G' ⧸ Γ' → K
hg : AEStronglyMeasurable g (Measure.map mk (Measure.restrict μ' 𝓕'))
g_ℒ_infinity : essSup (fun x => ↑‖g x‖₊) (Measure.map mk (Measure.restrict μ' 𝓕')) ≠ ⊤
F_ae_measurable : AEStronglyMeasurable (automorphize f) (Measure.map mk (Measure.restrict μ' 𝓕'))
h𝓕 : IsAddFundamentalDomain (↥(AddSubgroup.op Γ')) 𝓕'
π : G' → G' ⧸ Γ' := mk
meas_π : Measurable π
H₀ : automorphize (g ∘ π * f) = g * automorphize f
⊢ AEStronglyMeasurable (fun x => g ↑x) μ'

Next tactic:
refine (AEStronglyMeasurable.mono' hg ?_).comp_measurable meas_π
/-- This is the **Unfolding Trick**: Given an additive subgroup `Γ'` of an additive group `G'`, the
  integral of a function `f` on `G'` times the lift to `G'` of a function `g` on the quotient
  `G' ⧸ Γ'` with respect to a right-invariant measure `μ` on `G'`, is equal to the integral over
  the quotient of the automorphization of `f` times `g`. -/
lemma QuotientAddGroup.integral_mul_eq_integral_automorphize_mul {K : Type*} [NormedField K]
    [NormedSpace ℝ K] [μ'.IsAddRightInvariant] {f : G' → K}
    (f_ℒ_1 : Integrable f μ') {g : G' ⧸ Γ' → K} (hg : AEStronglyMeasurable g μ_𝓕)
    (g_ℒ_infinity : essSup (fun x ↦ (‖g x‖₊ : ℝ≥0∞)) μ_𝓕 ≠ ∞)
    (F_ae_measurable : AEStronglyMeasurable (QuotientAddGroup.automorphize f) μ_𝓕)
    (h𝓕 : IsAddFundamentalDomain Γ'.op 𝓕' μ') :
    ∫ x : G', g (x : G' ⧸ Γ') * (f x) ∂μ'
      = ∫ x : G' ⧸ Γ', g x * (QuotientAddGroup.automorphize f x) ∂μ_𝓕 := by
  let π : G' → G' ⧸ Γ' := QuotientAddGroup.mk
  have meas_π : Measurable π := continuous_quotient_mk'.measurable
  have H₀ : QuotientAddGroup.automorphize ((g ∘ π) * f) = g * (QuotientAddGroup.automorphize f) :=
    by exact QuotientAddGroup.automorphize_smul_left f g
  calc ∫ (x : G'), g (π x) * f x ∂μ' =
    ∫ (x : G' ⧸ Γ'), QuotientAddGroup.automorphize ((g ∘ π) * f) x ∂μ_𝓕 := ?_
    _ = ∫ (x : G' ⧸ Γ'), g x * (QuotientAddGroup.automorphize f x) ∂μ_𝓕 := by simp [H₀]
  have H₁ : Integrable ((g ∘ π) * f) μ'
  · have : AEStronglyMeasurable (fun (x : G') ↦ g (x : (G' ⧸ Γ'))) μ'
    · refine (AEStronglyMeasurable.mono' hg ?_).comp_measurable meas_π
      

Proof state:
case this
G : Type u_1
inst✝¹⁸ : Group G
inst✝¹⁷ : MeasurableSpace G
inst✝¹⁶ : TopologicalSpace G
inst✝¹⁵ : TopologicalGroup G
inst✝¹⁴ : BorelSpace G
μ : Measure G
Γ : Subgroup G
𝓕 : Set G
h𝓕✝ : IsFundamentalDomain (↥(Subgroup.op Γ)) 𝓕
inst✝¹³ : Countable ↥Γ
inst✝¹² : MeasurableSpace (G ⧸ Γ)
inst✝¹¹ : BorelSpace (G ⧸ Γ)
G' : Type u_2
inst✝¹⁰ : AddGroup G'
inst✝⁹ : MeasurableSpace G'
inst✝⁸ : TopologicalSpace G'
inst✝⁷ : TopologicalAddGroup G'
inst✝⁶ : BorelSpace G'
μ' : Measure G'
Γ' : AddSubgroup G'
inst✝⁵ : Countable ↥Γ'
inst✝⁴ : MeasurableSpace (G' ⧸ Γ')
inst✝³ : BorelSpace (G' ⧸ Γ')
𝓕' : Set G'
K : Type u_3
inst✝² : NormedField K
inst✝¹ : NormedSpace ℝ K
inst✝ : IsAddRightInvariant μ'
f : G' → K
f_ℒ_1 : Integrable f
g : G' ⧸ Γ' → K
hg : AEStronglyMeasurable g (Measure.map mk (Measure.restrict μ' 𝓕'))
g_ℒ_infinity : essSup (fun x => ↑‖g x‖₊) (Measure.map mk (Measure.restrict μ' 𝓕')) ≠ ⊤
F_ae_measurable : AEStronglyMeasurable (automorphize f) (Measure.map mk (Measure.restrict μ' 𝓕'))
h𝓕 : IsAddFundamentalDomain (↥(AddSubgroup.op Γ')) 𝓕'
π : G' → G' ⧸ Γ' := mk
meas_π : Measurable π
H₀ : automorphize (g ∘ π * f) = g * automorphize f
⊢ Measure.map (fun x => ↑x) μ' ≪ Measure.map mk (Measure.restrict μ' 𝓕')

Next tactic:
exact h𝓕.absolutelyContinuous_map
/-- This is the **Unfolding Trick**: Given an additive subgroup `Γ'` of an additive group `G'`, the
  integral of a function `f` on `G'` times the lift to `G'` of a function `g` on the quotient
  `G' ⧸ Γ'` with respect to a right-invariant measure `μ` on `G'`, is equal to the integral over
  the quotient of the automorphization of `f` times `g`. -/
lemma QuotientAddGroup.integral_mul_eq_integral_automorphize_mul {K : Type*} [NormedField K]
    [NormedSpace ℝ K] [μ'.IsAddRightInvariant] {f : G' → K}
    (f_ℒ_1 : Integrable f μ') {g : G' ⧸ Γ' → K} (hg : AEStronglyMeasurable g μ_𝓕)
    (g_ℒ_infinity : essSup (fun x ↦ (‖g x‖₊ : ℝ≥0∞)) μ_𝓕 ≠ ∞)
    (F_ae_measurable : AEStronglyMeasurable (QuotientAddGroup.automorphize f) μ_𝓕)
    (h𝓕 : IsAddFundamentalDomain Γ'.op 𝓕' μ') :
    ∫ x : G', g (x : G' ⧸ Γ') * (f x) ∂μ'
      = ∫ x : G' ⧸ Γ', g x * (QuotientAddGroup.automorphize f x) ∂μ_𝓕 := by
  let π : G' → G' ⧸ Γ' := QuotientAddGroup.mk
  have meas_π : Measurable π := continuous_quotient_mk'.measurable
  have H₀ : QuotientAddGroup.automorphize ((g ∘ π) * f) = g * (QuotientAddGroup.automorphize f) :=
    by exact QuotientAddGroup.automorphize_smul_left f g
  calc ∫ (x : G'), g (π x) * f x ∂μ' =
    ∫ (x : G' ⧸ Γ'), QuotientAddGroup.automorphize ((g ∘ π) * f) x ∂μ_𝓕 := ?_
    _ = ∫ (x : G' ⧸ Γ'), g x * (QuotientAddGroup.automorphize f x) ∂μ_𝓕 := by simp [H₀]
  have H₁ : Integrable ((g ∘ π) * f) μ'
  · have : AEStronglyMeasurable (fun (x : G') ↦ g (x : (G' ⧸ Γ'))) μ'
    · refine (AEStronglyMeasurable.mono' hg ?_).comp_measurable meas_π
      exact h𝓕.absolutelyContinuous_map
    

Proof state:
case H₁
G : Type u_1
inst✝¹⁸ : Group G
inst✝¹⁷ : MeasurableSpace G
inst✝¹⁶ : TopologicalSpace G
inst✝¹⁵ : TopologicalGroup G
inst✝¹⁴ : BorelSpace G
μ : Measure G
Γ : Subgroup G
𝓕 : Set G
h𝓕✝ : IsFundamentalDomain (↥(Subgroup.op Γ)) 𝓕
inst✝¹³ : Countable ↥Γ
inst✝¹² : MeasurableSpace (G ⧸ Γ)
inst✝¹¹ : BorelSpace (G ⧸ Γ)
G' : Type u_2
inst✝¹⁰ : AddGroup G'
inst✝⁹ : MeasurableSpace G'
inst✝⁸ : TopologicalSpace G'
inst✝⁷ : TopologicalAddGroup G'
inst✝⁶ : BorelSpace G'
μ' : Measure G'
Γ' : AddSubgroup G'
inst✝⁵ : Countable ↥Γ'
inst✝⁴ : MeasurableSpace (G' ⧸ Γ')
inst✝³ : BorelSpace (G' ⧸ Γ')
𝓕' : Set G'
K : Type u_3
inst✝² : NormedField K
inst✝¹ : NormedSpace ℝ K
inst✝ : IsAddRightInvariant μ'
f : G' → K
f_ℒ_1 : Integrable f
g : G' ⧸ Γ' → K
hg : AEStronglyMeasurable g (Measure.map mk (Measure.restrict μ' 𝓕'))
g_ℒ_infinity : essSup (fun x => ↑‖g x‖₊) (Measure.map mk (Measure.restrict μ' 𝓕')) ≠ ⊤
F_ae_measurable : AEStronglyMeasurable (automorphize f) (Measure.map mk (Measure.restrict μ' 𝓕'))
h𝓕 : IsAddFundamentalDomain (↥(AddSubgroup.op Γ')) 𝓕'
π : G' → G' ⧸ Γ' := mk
meas_π : Measurable π
H₀ : automorphize (g ∘ π * f) = g * automorphize f
this : AEStronglyMeasurable (fun x => g ↑x) μ'
⊢ Integrable (g ∘ π * f)

Next tactic:
refine Integrable.essSup_smul f_ℒ_1 this ?_
/-- This is the **Unfolding Trick**: Given an additive subgroup `Γ'` of an additive group `G'`, the
  integral of a function `f` on `G'` times the lift to `G'` of a function `g` on the quotient
  `G' ⧸ Γ'` with respect to a right-invariant measure `μ` on `G'`, is equal to the integral over
  the quotient of the automorphization of `f` times `g`. -/
lemma QuotientAddGroup.integral_mul_eq_integral_automorphize_mul {K : Type*} [NormedField K]
    [NormedSpace ℝ K] [μ'.IsAddRightInvariant] {f : G' → K}
    (f_ℒ_1 : Integrable f μ') {g : G' ⧸ Γ' → K} (hg : AEStronglyMeasurable g μ_𝓕)
    (g_ℒ_infinity : essSup (fun x ↦ (‖g x‖₊ : ℝ≥0∞)) μ_𝓕 ≠ ∞)
    (F_ae_measurable : AEStronglyMeasurable (QuotientAddGroup.automorphize f) μ_𝓕)
    (h𝓕 : IsAddFundamentalDomain Γ'.op 𝓕' μ') :
    ∫ x : G', g (x : G' ⧸ Γ') * (f x) ∂μ'
      = ∫ x : G' ⧸ Γ', g x * (QuotientAddGroup.automorphize f x) ∂μ_𝓕 := by
  let π : G' → G' ⧸ Γ' := QuotientAddGroup.mk
  have meas_π : Measurable π := continuous_quotient_mk'.measurable
  have H₀ : QuotientAddGroup.automorphize ((g ∘ π) * f) = g * (QuotientAddGroup.automorphize f) :=
    by exact QuotientAddGroup.automorphize_smul_left f g
  calc ∫ (x : G'), g (π x) * f x ∂μ' =
    ∫ (x : G' ⧸ Γ'), QuotientAddGroup.automorphize ((g ∘ π) * f) x ∂μ_𝓕 := ?_
    _ = ∫ (x : G' ⧸ Γ'), g x * (QuotientAddGroup.automorphize f x) ∂μ_𝓕 := by simp [H₀]
  have H₁ : Integrable ((g ∘ π) * f) μ'
  · have : AEStronglyMeasurable (fun (x : G') ↦ g (x : (G' ⧸ Γ'))) μ'
    · refine (AEStronglyMeasurable.mono' hg ?_).comp_measurable meas_π
      exact h𝓕.absolutelyContinuous_map
    refine Integrable.essSup_smul f_ℒ_1 this ?_
    

Proof state:
case H₁
G : Type u_1
inst✝¹⁸ : Group G
inst✝¹⁷ : MeasurableSpace G
inst✝¹⁶ : TopologicalSpace G
inst✝¹⁵ : TopologicalGroup G
inst✝¹⁴ : BorelSpace G
μ : Measure G
Γ : Subgroup G
𝓕 : Set G
h𝓕✝ : IsFundamentalDomain (↥(Subgroup.op Γ)) 𝓕
inst✝¹³ : Countable ↥Γ
inst✝¹² : MeasurableSpace (G ⧸ Γ)
inst✝¹¹ : BorelSpace (G ⧸ Γ)
G' : Type u_2
inst✝¹⁰ : AddGroup G'
inst✝⁹ : MeasurableSpace G'
inst✝⁸ : TopologicalSpace G'
inst✝⁷ : TopologicalAddGroup G'
inst✝⁶ : BorelSpace G'
μ' : Measure G'
Γ' : AddSubgroup G'
inst✝⁵ : Countable ↥Γ'
inst✝⁴ : MeasurableSpace (G' ⧸ Γ')
inst✝³ : BorelSpace (G' ⧸ Γ')
𝓕' : Set G'
K : Type u_3
inst✝² : NormedField K
inst✝¹ : NormedSpace ℝ K
inst✝ : IsAddRightInvariant μ'
f : G' → K
f_ℒ_1 : Integrable f
g : G' ⧸ Γ' → K
hg : AEStronglyMeasurable g (Measure.map mk (Measure.restrict μ' 𝓕'))
g_ℒ_infinity : essSup (fun x => ↑‖g x‖₊) (Measure.map mk (Measure.restrict μ' 𝓕')) ≠ ⊤
F_ae_measurable : AEStronglyMeasurable (automorphize f) (Measure.map mk (Measure.restrict μ' 𝓕'))
h𝓕 : IsAddFundamentalDomain (↥(AddSubgroup.op Γ')) 𝓕'
π : G' → G' ⧸ Γ' := mk
meas_π : Measurable π
H₀ : automorphize (g ∘ π * f) = g * automorphize f
this : AEStronglyMeasurable (fun x => g ↑x) μ'
⊢ essSup (fun x => ↑‖g ↑x‖₊) μ' ≠ ⊤

Next tactic:
have hg' : AEStronglyMeasurable (fun x ↦ (‖g x‖₊ : ℝ≥0∞)) μ_𝓕 :=
      (ENNReal.continuous_coe.comp continuous_nnnorm).comp_aestronglyMeasurable hg
/-- Auxiliary lemma for the divergence theorem. -/
theorem norm_volume_sub_integral_face_upper_sub_lower_smul_le {f : (Fin (n + 1) → ℝ) → E}
    {f' : (Fin (n + 1) → ℝ) →L[ℝ] E} (hfc : ContinuousOn f (Box.Icc I)) {x : Fin (n + 1) → ℝ}
    (hxI : x ∈ (Box.Icc I)) {a : E} {ε : ℝ} (h0 : 0 < ε)
    (hε : ∀ y ∈ (Box.Icc I), ‖f y - a - f' (y - x)‖ ≤ ε * ‖y - x‖) {c : ℝ≥0}
    (hc : I.distortion ≤ c) :
    ‖(∏ j, (I.upper j - I.lower j)) • f' (Pi.single i 1) -
      (integral (I.face i) ⊥ (f ∘ i.insertNth (α := fun _ ↦ ℝ) (I.upper i)) BoxAdditiveMap.volume -
        integral (I.face i) ⊥ (f ∘ i.insertNth (α := fun _ ↦ ℝ) (I.lower i))
          BoxAdditiveMap.volume)‖ ≤
      2 * ε * c * ∏ j, (I.upper j - I.lower j) := by
  -- Porting note: Lean fails to find `α` in the next line
  

Proof state:
E : Type u
inst✝² : NormedAddCommGroup E
inst✝¹ : NormedSpace ℝ E
n : ℕ
inst✝ : CompleteSpace E
I : Box (Fin (n + 1))
i : Fin (n + 1)
f : (Fin (n + 1) → ℝ) → E
f' : (Fin (n + 1) → ℝ) →L[ℝ] E
hfc : ContinuousOn f (Box.Icc I)
x : Fin (n + 1) → ℝ
hxI : x ∈ Box.Icc I
a : E
ε : ℝ
h0 : 0 < ε
hε : ∀ y ∈ Box.Icc I, ‖f y - a - f' (y - x)‖ ≤ ε * ‖y - x‖
c : ℝ≥0
hc : Box.distortion I ≤ c
⊢ ‖(∏ j : Fin (n + 1), (Box.upper I j - Box.lower I j)) • f' (Pi.single i 1) -
        (integral (Box.face I i) ⊥ (f ∘ Fin.insertNth i (Box.upper I i)) BoxAdditiveMap.volume -
          integral (Box.face I i) ⊥ (f ∘ Fin.insertNth i (Box.lower I i)) BoxAdditiveMap.volume)‖ ≤
    2 * ε * ↑c * ∏ j : Fin (n + 1), (Box.upper I j - Box.lower I j)

Next tactic:
set e : ℝ → (Fin n → ℝ) → (Fin (n + 1) → ℝ) := i.insertNth (α := fun _ ↦ ℝ)
/-- Auxiliary lemma for the divergence theorem. -/
theorem norm_volume_sub_integral_face_upper_sub_lower_smul_le {f : (Fin (n + 1) → ℝ) → E}
    {f' : (Fin (n + 1) → ℝ) →L[ℝ] E} (hfc : ContinuousOn f (Box.Icc I)) {x : Fin (n + 1) → ℝ}
    (hxI : x ∈ (Box.Icc I)) {a : E} {ε : ℝ} (h0 : 0 < ε)
    (hε : ∀ y ∈ (Box.Icc I), ‖f y - a - f' (y - x)‖ ≤ ε * ‖y - x‖) {c : ℝ≥0}
    (hc : I.distortion ≤ c) :
    ‖(∏ j, (I.upper j - I.lower j)) • f' (Pi.single i 1) -
      (integral (I.face i) ⊥ (f ∘ i.insertNth (α := fun _ ↦ ℝ) (I.upper i)) BoxAdditiveMap.volume -
        integral (I.face i) ⊥ (f ∘ i.insertNth (α := fun _ ↦ ℝ) (I.lower i))
          BoxAdditiveMap.volume)‖ ≤
      2 * ε * c * ∏ j, (I.upper j - I.lower j) := by
  -- Porting note: Lean fails to find `α` in the next line
  set e : ℝ → (Fin n → ℝ) → (Fin (n + 1) → ℝ) := i.insertNth (α := fun _ ↦ ℝ)
  /- **Plan of the proof**. The difference of the integrals of the affine function
    `fun y ↦ a + f' (y - x)` over the faces `x i = I.upper i` and `x i = I.lower i` is equal to the
    volume of `I` multiplied by `f' (Pi.single i 1)`, so it suffices to show that the integral of
    `f y - a - f' (y - x)` over each of these faces is less than or equal to `ε * c * vol I`. We
    integrate a function of the norm `≤ ε * diam I.Icc` over a box of volume
    `∏ j ≠ i, (I.upper j - I.lower j)`. Since `diam I.Icc ≤ c * (I.upper i - I.lower i)`, we get the
    required estimate.  -/
  

Proof state:
E : Type u
inst✝² : NormedAddCommGroup E
inst✝¹ : NormedSpace ℝ E
n : ℕ
inst✝ : CompleteSpace E
I : Box (Fin (n + 1))
i : Fin (n + 1)
f : (Fin (n + 1) → ℝ) → E
f' : (Fin (n + 1) → ℝ) →L[ℝ] E
hfc : ContinuousOn f (Box.Icc I)
x : Fin (n + 1) → ℝ
hxI : x ∈ Box.Icc I
a : E
ε : ℝ
h0 : 0 < ε
hε : ∀ y ∈ Box.Icc I, ‖f y - a - f' (y - x)‖ ≤ ε * ‖y - x‖
c : ℝ≥0
hc : Box.distortion I ≤ c
e : ℝ → (Fin n → ℝ) → Fin (n + 1) → ℝ := Fin.insertNth i
⊢ ‖(∏ j : Fin (n + 1), (Box.upper I j - Box.lower I j)) • f' (Pi.single i 1) -
        (integral (Box.face I i) ⊥ (f ∘ e (Box.upper I i)) BoxAdditiveMap.volume -
          integral (Box.face I i) ⊥ (f ∘ e (Box.lower I i)) BoxAdditiveMap.volume)‖ ≤
    2 * ε * ↑c * ∏ j : Fin (n + 1), (Box.upper I j - Box.lower I j)

Next tactic:
have Hl : I.lower i ∈ Icc (I.lower i) (I.upper i) := Set.left_mem_Icc.2 (I.lower_le_upper i)
/-- Auxiliary lemma for the divergence theorem. -/
theorem norm_volume_sub_integral_face_upper_sub_lower_smul_le {f : (Fin (n + 1) → ℝ) → E}
    {f' : (Fin (n + 1) → ℝ) →L[ℝ] E} (hfc : ContinuousOn f (Box.Icc I)) {x : Fin (n + 1) → ℝ}
    (hxI : x ∈ (Box.Icc I)) {a : E} {ε : ℝ} (h0 : 0 < ε)
    (hε : ∀ y ∈ (Box.Icc I), ‖f y - a - f' (y - x)‖ ≤ ε * ‖y - x‖) {c : ℝ≥0}
    (hc : I.distortion ≤ c) :
    ‖(∏ j, (I.upper j - I.lower j)) • f' (Pi.single i 1) -
      (integral (I.face i) ⊥ (f ∘ i.insertNth (α := fun _ ↦ ℝ) (I.upper i)) BoxAdditiveMap.volume -
        integral (I.face i) ⊥ (f ∘ i.insertNth (α := fun _ ↦ ℝ) (I.lower i))
          BoxAdditiveMap.volume)‖ ≤
      2 * ε * c * ∏ j, (I.upper j - I.lower j) := by
  -- Porting note: Lean fails to find `α` in the next line
  set e : ℝ → (Fin n → ℝ) → (Fin (n + 1) → ℝ) := i.insertNth (α := fun _ ↦ ℝ)
  /- **Plan of the proof**. The difference of the integrals of the affine function
    `fun y ↦ a + f' (y - x)` over the faces `x i = I.upper i` and `x i = I.lower i` is equal to the
    volume of `I` multiplied by `f' (Pi.single i 1)`, so it suffices to show that the integral of
    `f y - a - f' (y - x)` over each of these faces is less than or equal to `ε * c * vol I`. We
    integrate a function of the norm `≤ ε * diam I.Icc` over a box of volume
    `∏ j ≠ i, (I.upper j - I.lower j)`. Since `diam I.Icc ≤ c * (I.upper i - I.lower i)`, we get the
    required estimate.  -/
  have Hl : I.lower i ∈ Icc (I.lower i) (I.upper i) := Set.left_mem_Icc.2 (I.lower_le_upper i)
  

Proof state:
E : Type u
inst✝² : NormedAddCommGroup E
inst✝¹ : NormedSpace ℝ E
n : ℕ
inst✝ : CompleteSpace E
I : Box (Fin (n + 1))
i : Fin (n + 1)
f : (Fin (n + 1) → ℝ) → E
f' : (Fin (n + 1) → ℝ) →L[ℝ] E
hfc : ContinuousOn f (Box.Icc I)
x : Fin (n + 1) → ℝ
hxI : x ∈ Box.Icc I
a : E
ε : ℝ
h0 : 0 < ε
hε : ∀ y ∈ Box.Icc I, ‖f y - a - f' (y - x)‖ ≤ ε * ‖y - x‖
c : ℝ≥0
hc : Box.distortion I ≤ c
e : ℝ → (Fin n → ℝ) → Fin (n + 1) → ℝ := Fin.insertNth i
Hl : Box.lower I i ∈ Set.Icc (Box.lower I i) (Box.upper I i)
⊢ ‖(∏ j : Fin (n + 1), (Box.upper I j - Box.lower I j)) • f' (Pi.single i 1) -
        (integral (Box.face I i) ⊥ (f ∘ e (Box.upper I i)) BoxAdditiveMap.volume -
          integral (Box.face I i) ⊥ (f ∘ e (Box.lower I i)) BoxAdditiveMap.volume)‖ ≤
    2 * ε * ↑c * ∏ j : Fin (n + 1), (Box.upper I j - Box.lower I j)

Next tactic:
have Hu : I.upper i ∈ Icc (I.lower i) (I.upper i) := Set.right_mem_Icc.2 (I.lower_le_upper i)