@@ -6,6 +6,8 @@ import Mathlib.MeasureTheory.Measure.WithDensity
66import Mathlib.MeasureTheory.Function.Jacobian
77import Mathlib.Analysis.Calculus.FDeriv.RestrictScalars
88
9+ import ModularFormDimensions.Divisor
10+
911open MeasureTheory
1012
1113noncomputable section
@@ -21,11 +23,11 @@ lemma measurableEmbedding_coe : MeasurableEmbedding UpperHalfPlane.coe :=
2123
2224/-- The invariant measure on the upper half-plane, defined by `dx dy / y ^ 2`. -/
2325instance : MeasureSpace ℍ :=
24- ⟨(volume.comap UpperHalfPlane.coe).withDensity fun z ↦ ( 1 / ⟨z.im, z.im_pos.le⟩ : NNReal) ^ 2 ⟩
26+ ⟨(volume.comap UpperHalfPlane.coe).withDensity fun z ↦ ↑(( 1 / ⟨z.im, z.im_pos.le⟩ : NNReal) ^ 2 ) ⟩
2527
2628/-- Express the volume of a measurable set as a lintegral over the corresponding subset of `ℂ`. -/
2729lemma volume_eq_lintegral {s : Set ℍ} (hs : MeasurableSet s) :
28- volume s = ∫⁻ z : ℂ in (↑) '' s, ( 1 / ‖z.im‖₊) ^ 2 := by
30+ volume s = ∫⁻ z : ℂ in (↑) '' s, ↑(( 1 / ‖z.im‖₊) ^ 2 : NNReal) := by
2931 simp only [volume, one_div]
3032 -- This proof is annoying because `setLIntegral_subtype` only works on a literal subtype,
3133 -- while `UpperHalfPlane` is a _type alias_ for a subtype, so we need to do some annoying
@@ -34,38 +36,55 @@ lemma volume_eq_lintegral {s : Set ℍ} (hs : MeasurableSet s) :
3436 ← setLIntegral_subtype (by exact isOpen_upperHalfPlaneSet.measurableSet),
3537 withDensity_apply _ hs]
3638 congr 1 with z
37- rw [ENNReal.coe_inv (mod_cast NNReal.coe_ne_zero.mp z.im_pos.ne')]
38- congr
39+ congr 4
3940 rw [Real.norm_of_nonneg (by simpa using z.im_pos.le), ← z.coe_im,
4041 show UpperHalfPlane.coe = Subtype.val from rfl]
4142
43+ /-- The measure on the upper half-plane is invariant under `GL(2, ℝ)`. -/
4244instance : SMulInvariantMeasure (GL (Fin 2 ) ℝ) ℍ volume := by
45+ -- It suffices to show `volume (g • s) = volume s` for measurable sets `s`. First
46+ -- we write this as a lintegral over subsets of `ℂ`.
4347 refine ((smulInvariantMeasure_tfae _ _).out 2 0 ).mp fun g s hs ↦ ?_
4448 rw [volume_eq_lintegral hs, volume_eq_lintegral (hs.const_smul _)]
45-
46- have aux1a (x : ℂ) (hx : x ∈ UpperHalfPlane.coe '' s) :
47- HasFDerivWithinAt (𝕜 := ℂ) (smulAux' g) (17 ) (UpperHalfPlane.coe '' s) x := by
48- sorry
49-
50- have aux1b (x : ℂ) (hx : x ∈ UpperHalfPlane.coe '' s) :
51- HasFDerivWithinAt (𝕜 := ℝ) (smulAux' g) (
52- ContinuousLinearMap.restrictScalars ℝ (17 : ℂ →L[ℂ] ℂ)) (UpperHalfPlane.coe '' s) x :=
53- (aux1a x hx).restrictScalars ℝ
54-
49+ -- We want to apply the Jacobian change-of-variable formula, so first
50+ -- we establish the hypotheses.
51+ have aux1 (x : ℂ) (hx : x ∈ UpperHalfPlane.coe '' s) :
52+ HasFDerivWithinAt (𝕜 := ℝ) (smulAux' g) (smulFDeriv g x) (UpperHalfPlane.coe '' s) x := by
53+ apply HasFDerivAt.hasFDerivWithinAt
54+ rcases hx with ⟨τ, hτ, rfl⟩
55+ apply (UpperHalfPlane.hasFDerivAt_smul g τ).congr_of_eventuallyEq
56+ filter_upwards [isOpen_upperHalfPlaneSet.mem_nhds τ.property] with z hz
57+ simp_all [σ, coe_smul, ofComplex_apply_of_im_pos, smulAux']
5558 have aux2 : ((↑) '' s).InjOn (smulAux' g) := by
5659 rintro _ ⟨x, hx, rfl⟩ _ ⟨y, hy, rfl⟩
5760 rw [← UpperHalfPlane.ext_iff]
5861 change (↑(g • x) : ℂ) = ↑(g • y) → x = y
5962 simp only [ext_iff', smul_left_cancel_iff, imp_self]
60-
61- convert MeasureTheory.lintegral_image_eq_lintegral_abs_det_fderiv_mul
62- volume (measurableEmbedding_coe.measurableSet_image.mpr hs)
63- (fun a ha ↦ (aux1a a ha).restrictScalars ℝ) aux2
64- (fun z ↦ (1 / ‖z.im‖₊) ^ 2 )
65- · have : smulAux' g ∘ ((↑) : ℍ → ℂ) = (↑) ∘ (fun x ↦ g • x) := by rfl
66- rw [← Set.image_comp, this, Set.image_comp, Set.image_smul]
67- · sorry
68-
63+ -- Now invoke the change-of-variable formula.
64+ have main := MeasureTheory.lintegral_image_eq_lintegral_abs_det_fderiv_mul
65+ volume (measurableEmbedding_coe.measurableSet_image.mpr hs) aux1 aux2
66+ (fun z ↦ ↑((1 / ‖z.im‖₊) ^ 2 : NNReal))
67+ -- Adjust the LHS of the resulting statement slightly to match our goal.
68+ have aux3 : smulAux' g ∘ ((↑) : ℍ → ℂ) = (↑) ∘ (fun x ↦ g • x) := by rfl
69+ rw [← Set.image_comp, aux3, Set.image_comp, Set.image_smul] at main
70+ rw [main]
71+ -- Now it remains to compare two integrals over `coe '' s`.
72+ apply setLIntegral_congr_fun (measurableEmbedding_coe.measurableSet_image.mpr hs)
73+ rintro _ ⟨τ, hτ, rfl⟩
74+ simp only [det_smulFDeriv, abs_div, abs_mul, abs_pow, abs_pow, sq_abs,
75+ (show Even 4 by grind).pow_abs]
76+ have : |(SignType.sign g.det.val : ℝ)| = 1 := by
77+ rcases lt_or_gt_of_ne (NeZero.ne g.det.val) with h | h <;>
78+ simp [-Matrix.GeneralLinearGroup.val_det_apply, h]
79+ rw [this, one_mul, ENNReal.ofReal_eq_coe_nnreal (by positivity), ← ENNReal.coe_mul,
80+ ENNReal.coe_inj, NNReal.eq_iff]
81+ push_cast
82+ rw [div_pow, one_pow, mul_one_div, show 4 = 2 * 2 by rfl, pow_mul, ← div_pow, ← div_pow]
83+ simp only [sq_eq_sq_iff_abs_eq_abs, abs_div, abs_pow, abs_one, abs_norm,
84+ show smulAux' g τ = ↑(g • τ) by rfl, coe_im, im_smul_eq_div_normSq, Complex.normSq_eq_norm_sq]
85+ simp only [norm_div, norm_pow, norm_mul, norm_abs_eq_norm, Real.norm_eq_abs, abs_norm]
86+ rw [div_div_div_cancel_right₀ (by simpa using denom_ne_zero g τ),
87+ ← div_div, div_self (by aesop)]
6988
7089end UpperHalfPlane
7190
0 commit comments