import Carleson.ToMathlib.Annulus import Carleson.ToMathlib.MeasureTheory.Measure.IsDoubling import Carleson.ToMathlib.WeakType import Mathlib.Analysis.CStarAlgebra.Classes import Mathlib.Analysis.Fourier.AddCircle open MeasureTheory Measure Metric Complex Set Function ENNReal open scoped NNReal noncomputable section /-! # Main statements of the Carleson project This file contains the statements of the main theorems from the Carleson formalization project: Theorem 1.0.1 (classical Carleson), Theorem 1.1.1 (metric space Carleson) and Theorem 1.1.2 (linearised metric Carleson), as well as the definitions required to state these results. ## Main definitions - `MeasureTheory.DoublingMeasure`: A metric space with a measure with some nice propreties, including a doubling condition. This is called a "doubling metric measure space" in the blueprint. - `FunctionDistances`: class stating that continuous functions have distances associated to every ball. - `IsOneSidedKernel K` states that `K` is a one-sided Calderon-Zygmund kernel. - `KernelProofData`: Data common through most of chapters 2-7. These contain the minimal axioms for `kernel-summand`'s proof. - `ClassicalCarleson`: statement of Carleson's theorem asserting a.e. convergence of the partial Fourier sums for continous functions (Theorem 1.0.1 in the blueprint). - `MetricSpaceCarleson`: statement of Theorem 1.1.1 from the blueprint. - `LinearizedMetricCarleson`: statement of Theorem 1.1.2 from the blueprint. -/ section DoublingMeasure universe u /- # Doubling metric measure spaces -/ /-- A metric space with a measure with some nice propreties, including a doubling condition. This is called a "doubling metric measure space" in the blueprint. `A` will usually be `2 ^ a`. -/ class MeasureTheory.DoublingMeasure (X : Type*) (A : outParam ℝβ‰₯0) [PseudoMetricSpace X] extends CompleteSpace X, LocallyCompactSpace X, MeasureSpace X, BorelSpace X, IsLocallyFiniteMeasure (volume : Measure X), IsDoubling (volume : Measure X) A, NeZero (volume : Measure X) where variable {π•œ X : Type*} {A : β„•} [_root_.RCLike π•œ] [PseudoMetricSpace X] /-- The local oscillation of two functions w.r.t. a set `E`. This is `d_E` in the blueprint. -/ def localOscillation (E : Set X) (f g : C(X, π•œ)) : ℝβ‰₯0∞ := ⨆ z ∈ E Γ—Λ’ E, ENNReal.ofReal β€–f z.1 - g z.1 - f z.2 + g z.2β€– /-- A class stating that continuous functions have distances associated to every ball. We use a separate type to conveniently index these functions. -/ class FunctionDistances (π•œ : outParam Type*) (X : Type u) [NormedField π•œ] [TopologicalSpace X] where /-- A type of continuous functions from `X` to `π•œ`. -/ Θ : Type u /-- The coercion map from `Θ` to `C(X, π•œ)`. -/ coeΘ : Θ β†’ C(X, π•œ) /-- Injectivity of the coercion map from `Θ` to `C(X, π•œ)`. -/ coeΘ_injective {f g : Θ} (h : βˆ€ x, coeΘ f x = coeΘ g x) : f = g /-- For each `_x : X` and `_r : ℝ`, a `PseudoMetricSpace Θ`. -/ metric : βˆ€ (_x : X) (_r : ℝ), PseudoMetricSpace Θ export FunctionDistances (Θ coeΘ) section FunctionDistances variable [FunctionDistances π•œ X] instance : Coe (Θ X) C(X, π•œ) := ⟨FunctionDistances.coeΘ⟩ instance : FunLike (Θ X) X π•œ where coe := fun f ↦ (f : C(X, π•œ)) coe_injective' _ _ hfg := FunctionDistances.coeΘ_injective fun x ↦ congrFun hfg x set_option linter.unusedVariables false in /-- Class used to endow `Θ X` with a pseudometric space structure. -/ @[nolint unusedArguments] def WithFunctionDistance (x : X) (r : ℝ) := Θ X instance {x : X} {r : ℝ} [d : FunctionDistances π•œ X] : PseudoMetricSpace (WithFunctionDistance x r) := d.metric x r end FunctionDistances /-- The real-valued distance function on `WithFunctionDistance x r`. -/ notation3 "dist_{" x ", " r "}" => @dist (WithFunctionDistance x r) _ /-- The `ℝβ‰₯0∞`-valued distance function on `WithFunctionDistance x r`. Preferred over `nndist`. -/ notation3 "edist_{" x ", " r "}" => @edist (WithFunctionDistance x r) _ /-- A set `Θ` of (continuous) functions is compatible. `A` will usually be `2 ^ a`. -/ class CompatibleFunctions (π•œ : outParam Type*) (X : Type u) (A : outParam β„•) [RCLike π•œ] [PseudoMetricSpace X] extends FunctionDistances π•œ X where eq_zero : βˆƒ o : X, βˆ€ f : Θ, coeΘ f o = 0 /-- The distance is bounded below by the local oscillation. (1.1.4) -/ localOscillation_le_cdist {x : X} {r : ℝ} {f g : Θ} : localOscillation (ball x r) (coeΘ f) (coeΘ g) ≀ ENNReal.ofReal (dist_{x, r} f g) /-- The distance is monotone in the ball. (1.1.6) -/ cdist_mono {x₁ xβ‚‚ : X} {r₁ rβ‚‚ : ℝ} {f g : Θ} (h : ball x₁ r₁ βŠ† ball xβ‚‚ rβ‚‚) : dist_{x₁, r₁} f g ≀ dist_{xβ‚‚, rβ‚‚} f g /-- The distance of a ball with large radius is bounded above. (1.1.5) -/ cdist_le {x₁ xβ‚‚ : X} {r : ℝ} {f g : Θ} (h : dist x₁ xβ‚‚ < 2 * r) : dist_{xβ‚‚, 2 * r} f g ≀ A * dist_{x₁, r} f g /-- The distance of a ball with large radius is bounded below. (1.1.7) -/ le_cdist {x₁ xβ‚‚ : X} {r : ℝ} {f g : Θ} (h1 : ball x₁ r βŠ† ball xβ‚‚ (A * r)) : /-(h2 : A * r ≀ Metric.diam (univ : Set X))-/ 2 * dist_{x₁, r} f g ≀ dist_{xβ‚‚, A * r} f g /-- Every ball of radius `2R` can be covered by `A` balls of radius `R`. (1.1.8) -/ allBallsCoverBalls {x : X} {r : ℝ} : AllBallsCoverBalls (WithFunctionDistance x r) 2 A variable [hXA : DoublingMeasure X A] /-- The inhomogeneous Lipschitz norm on a ball. -/ def iLipENorm {π•œ X : Type*} [NormedField π•œ] [PseudoMetricSpace X] (Ο† : X β†’ π•œ) (xβ‚€ : X) (R : ℝ) : ℝβ‰₯0∞ := (⨆ x ∈ ball xβ‚€ R, β€–Ο† xβ€–β‚‘) + ENNReal.ofReal R * ⨆ (x ∈ ball xβ‚€ R) (y ∈ ball xβ‚€ R) (_ : x β‰  y), β€–Ο† x - Ο† yβ€–β‚‘ / edist x y variable (X) in /-- Θ is Ο„-cancellative. `Ο„` will usually be `1 / a` -/ class IsCancellative (Ο„ : ℝ) [CompatibleFunctions ℝ X A] : Prop where /- We register a definition with strong assumptions, which makes them easier to prove. However, `enorm_integral_exp_le` removes them for easier application. -/ enorm_integral_exp_le' {x : X} {r : ℝ} {Ο† : X β†’ β„‚} (hr : 0 < r) (h1 : iLipENorm Ο† x r β‰  ∞) (h2 : support Ο† βŠ† ball x r) {f g : Θ X} : β€–βˆ« x, exp (I * (f x - g x)) * Ο† xβ€–β‚‘ ≀ (A : ℝβ‰₯0∞) * volume (ball x r) * iLipENorm Ο† x r * (1 + edist_{x, r} f g) ^ (- Ο„) /-- The "volume function" `V`. Preferably use `vol` instead. -/ protected def Real.vol {X : Type*} [PseudoMetricSpace X] [MeasureSpace X] (x y : X) : ℝ := volume.real (ball x (dist x y)) /-- `R_Q(ΞΈ, x)` defined in (1.1.17). -/ def upperRadius [FunctionDistances ℝ X] (Q : X β†’ Θ X) (ΞΈ : Θ X) (x : X) : ℝβ‰₯0∞ := ⨆ (r : ℝ) (_ : dist_{x, r} ΞΈ (Q x) < 1), ENNReal.ofReal r /-- The linearized maximally truncated nontangential Calderon–Zygmund operator `T_Q^ΞΈ`. -/ def linearizedNontangentialOperator [FunctionDistances ℝ X] (Q : X β†’ Θ X) (ΞΈ : Θ X) (K : X β†’ X β†’ β„‚) (f : X β†’ β„‚) (x : X) : ℝβ‰₯0∞ := ⨆ (Rβ‚‚ : ℝ) (R₁ ∈ Ioo 0 Rβ‚‚) (x' ∈ ball x R₁), β€–βˆ« y in EAnnulus.oo x' (ENNReal.ofReal R₁) (min (ENNReal.ofReal Rβ‚‚) (upperRadius Q ΞΈ x')), K x' y * f yβ€–β‚‘ /-- The maximally truncated nontangential Calderon–Zygmund operator `T_*`. -/ def nontangentialOperator (K : X β†’ X β†’ β„‚) (f : X β†’ β„‚) (x : X) : ℝβ‰₯0∞ := ⨆ (Rβ‚‚ : ℝ) (R₁ ∈ Ioo 0 Rβ‚‚) (x' ∈ ball x R₁), β€–βˆ« y in Annulus.oo x' R₁ Rβ‚‚, K x' y * f yβ€–β‚‘ /-- The integrand in the (linearized) Carleson operator. This is `G` in Lemma 3.0.1. -/ def carlesonOperatorIntegrand [FunctionDistances ℝ X] (K : X β†’ X β†’ β„‚) (ΞΈ : Θ X) (R₁ Rβ‚‚ : ℝ) (f : X β†’ β„‚) (x : X) : β„‚ := ∫ y in Annulus.oo x R₁ Rβ‚‚, K x y * f y * exp (I * ΞΈ y) /-- The linearized generalized Carleson operator `T_Q`, taking values in `ℝβ‰₯0∞`. Use `ENNReal.toReal` to get the corresponding real number. -/ def linearizedCarlesonOperator [FunctionDistances ℝ X] (Q : X β†’ Θ X) (K : X β†’ X β†’ β„‚) (f : X β†’ β„‚) (x : X) : ℝβ‰₯0∞ := ⨆ (R₁ : ℝ) (Rβ‚‚ : ℝ) (_ : 0 < R₁) (_ : R₁ < Rβ‚‚), β€–carlesonOperatorIntegrand K (Q x) R₁ Rβ‚‚ f xβ€–β‚‘ /-- The generalized Carleson operator `T`, taking values in `ℝβ‰₯0∞`. Use `ENNReal.toReal` to get the corresponding real number. -/ def carlesonOperator [FunctionDistances ℝ X] (K : X β†’ X β†’ β„‚) (f : X β†’ β„‚) (x : X) : ℝβ‰₯0∞ := ⨆ (ΞΈ : Θ X), linearizedCarlesonOperator (fun _ ↦ ΞΈ) K f x end DoublingMeasure /-- The main constant in the blueprint, driving all the construction, is `D = 2 ^ (100 * a ^ 2)`. It turns out that the proof is robust, and works for other values of `100`, giving better constants in the end. We will formalize it using a parameter `𝕔` (that we fix equal to `100` to follow the blueprint) and having `D = 2 ^ (𝕔 * a ^ 2)`. We register two lemmas `seven_le_c` and `c_le_100` and will never unfold `𝕔` from this point on. -/ irreducible_def 𝕔 : β„• := 100 /-- This is usually the value of the argument `A` in `DoublingMeasure` and `CompatibleFunctions` -/ @[simp] abbrev defaultA (a : β„•) : β„• := 2 ^ a /-- `defaultΟ„` is the inverse of `a`. -/ @[simp] def defaultΟ„ (a : β„•) : ℝ := a⁻¹ section Kernel variable {X : Type*} {a : β„•} {K : X β†’ X β†’ β„‚} [PseudoMetricSpace X] [MeasureSpace X] open Function /-- The constant used twice in the definition of the Calderon-Zygmund kernel. -/ @[simp] def C_K (a : ℝ) : ℝβ‰₯0 := 2 ^ a ^ 3 /-- `K` is a one-sided Calderon-Zygmund kernel. In the formalization `K x y` is defined everywhere, even for `x = y`. The assumptions on `K` show that `K x x = 0`. -/ class IsOneSidedKernel (a : outParam β„•) (K : X β†’ X β†’ β„‚) : Prop where measurable_K : Measurable (uncurry K) norm_K_le_vol_inv (x y : X) : β€–K x yβ€– ≀ C_K a / Real.vol x y norm_K_sub_le {x y y' : X} (h : 2 * dist y y' ≀ dist x y) : β€–K x y - K x y'β€– ≀ (dist y y' / dist x y) ^ (a : ℝ)⁻¹ * (C_K a / Real.vol x y) end Kernel /-- A constant used on the boundedness of `T_Q^ΞΈ` and `T_*`. We generally assume `HasBoundedStrongType (linearizedNontangentialOperator Q ΞΈ K Β· Β·) 2 2 volume volume (C_Ts a)` throughout this formalization. -/ def C_Ts (a : β„•) : ℝβ‰₯0 := 2 ^ a ^ 3 /-- Data common through most of chapters 2-7. These contain the minimal axioms for `kernel-summand`'s proof. This is used in chapter 3 when we don't have all other fields from `ProofData`. -/ class KernelProofData {X : Type*} (a : outParam β„•) (K : outParam (X β†’ X β†’ β„‚)) [PseudoMetricSpace X] where d : DoublingMeasure X (defaultA a) four_le_a : 4 ≀ a cf : CompatibleFunctions ℝ X (defaultA a) hcz : IsOneSidedKernel a K export KernelProofData (four_le_a) attribute [instance] KernelProofData.d KernelProofData.cf KernelProofData.hcz section statements /- ## Main statements This section contains the statements of the main theorems from the project: Theorem 1.0.1 (classical Carleson), Theorem 1.1.1 (metric space Carleson) and Theorem 1.1.2 (linearised metric Carleson). -/ set_option linter.unusedVariables false open Real /-- The Nα΅—Κ° partial Fourier sum of `f : ℝ β†’ β„‚` for `N : β„•`. -/ def partialFourierSum (N : β„•) (f : ℝ β†’ β„‚) (x : ℝ) : β„‚ := βˆ‘ n ∈ Finset.Icc (-(N : β„€)) N, fourierCoeffOn Real.two_pi_pos f n * fourier n (x : AddCircle (2 * Ο€)) local notation "S_" => partialFourierSum /-- Theorem 1.0.1: Carleson's theorem asserting a.e. convergence of the partial Fourier sums for continous functions. For the proof, see `classical_carleson` in the file `Carleson.Classical.ClassicalCarleson`. -/ def ClassicalCarleson : Prop := βˆ€ {f : ℝ β†’ β„‚} (cont_f : Continuous f) (periodic_f : f.Periodic (2 * Ο€)), βˆ€α΅ x, Filter.Tendsto (S_ Β· f x) Filter.atTop (nhds (f x)) /-- The constant used in `MetricSpaceCarleson` and `LinearizedMetricCarleson`. Has value `2 ^ (443 * a ^ 3) / (q - 1) ^ 6` in the blueprint. -/ def C1_0_2 (a : β„•) (q : ℝβ‰₯0) : ℝβ‰₯0 := 2 ^ ((3 * 𝕔 + 18 + 5 * (𝕔 / 4)) * a ^ 3) / (q - 1) ^ 6 /-- Theorem 1.1.1. For the proof, see `metric_carleson` in the file `Carleson.MetricCarleson.Main`. -/ def MetricSpaceCarleson : Prop := βˆ€ {X : Type*} {a : β„•} [MetricSpace X] {q q' : ℝβ‰₯0} {F G : Set X} {K : X β†’ X β†’ β„‚} [KernelProofData a K] {f : X β†’ β„‚} [IsCancellative X (defaultΟ„ a)] (hq : q ∈ Ioc 1 2) (hqq' : q.HolderConjugate q') (mF : MeasurableSet F) (mG : MeasurableSet G) (mf : Measurable f) (nf : (β€–f Β·β€–) ≀ F.indicator 1) (hT : HasBoundedStrongType (nontangentialOperator K Β· Β·) 2 2 volume volume (C_Ts a)), ∫⁻ x in G, carlesonOperator K f x ≀ C1_0_2 a q * volume G ^ (q' : ℝ)⁻¹ * volume F ^ (q : ℝ)⁻¹ /-- Theorem 1.1.2. For the proof, see `linearized_metric_carleson` in the file `Carleson.MetricCarleson.Linearized`. -/ def LinearizedMetricCarleson : Prop := βˆ€ {X : Type*} {a : β„•} [MetricSpace X] {q q' : ℝβ‰₯0} {F G : Set X} {K : X β†’ X β†’ β„‚} [KernelProofData a K] {Q : SimpleFunc X (Θ X)} {f : X β†’ β„‚} [IsCancellative X (defaultΟ„ a)] (hq : q ∈ Ioc 1 2) (hqq' : q.HolderConjugate q') (mF : MeasurableSet F) (mG : MeasurableSet G) (mf : Measurable f) (nf : (β€–f Β·β€–) ≀ F.indicator 1) (hT : βˆ€ ΞΈ : Θ X, HasBoundedStrongType (linearizedNontangentialOperator Q ΞΈ K Β· Β·) 2 2 volume volume (C_Ts a)), ∫⁻ x in G, linearizedCarlesonOperator Q K f x ≀ C1_0_2 a q * volume G ^ (q' : ℝ)⁻¹ * volume F ^ (q : ℝ)⁻¹ end statements