{"path": "TauCeti/Analysis/Analytic/MultiIndex/CoordinateDivision.lean", "module": "TauCeti.Analysis.Analytic.MultiIndex.CoordinateDivision", "theorem": "AnalyticAt.exists_eventuallyEq_prod_sub_pow_smul", "prefix": "/-\nCopyright (c) 2026 The Tau Ceti contributors. All rights reserved.\nReleased under Apache 2.0 license as described in the file LICENSE.\nAuthors: The Tau Ceti contributors\n-/\nmodule\n\npublic import TauCeti.Analysis.Analytic.MultiIndex.TaylorCoeff\nimport TauCeti.Algebra.BigOperators.Pi\nimport TauCeti.Algebra.Order.Pi\nimport TauCeti.Analysis.Analytic.Constructions\nimport TauCeti.Topology.Algebra.InfiniteSum.Real\n\n/-!\n# Division of a multi-index power series by a monomial\n\nFor a complete target space, suppose a multi-index expansion of `f` at `x` has weighted norm\nsummability at every positive radius smaller than `r`, and its coefficients vanish outside\nthe upper cone of an exponent vector `shift`. Shifting the exponents gives a quotient `g`\nanalytic on the zero-centred open polydisc of radius `r`, with\n`f (x + y) = (\u220f j, y j ^ shift j) \u2022 g y` there. The radius may be infinite.\nCoordinate division is the specialization to `shift = Pi.single i m`.\n\n## Main results\n\n* `TauCeti.exists_analyticOnNhd_eq_prod_pow_smul`: monomial division on the whole polydisc.\n* `TauCeti.exists_analyticOnNhd_eq_coord_pow_smul`: coordinate division on the whole polydisc.\n* `AnalyticAt.exists_eventuallyEq_prod_sub_pow_smul`: local monomial division when Taylor\n coefficients vanish outside the upper cone of the exponent vector.\n* `AnalyticAt.exists_eventuallyEq_coord_sub_pow_smul`: its coordinate-power specialization.\n* `AnalyticAt.exists_eventuallyEq_coord_sub_smul`: local division for a function whose\n restriction to the coordinate hyperplane through `x` vanishes near `x`.\n* `AnalyticAt.exists_sub_update_eventuallyEq_coord_sub_smul`: for a function analytic at `x` with\n complete target, local division after subtracting the restriction to the coordinate hyperplane\n through the centre.\n\n## References\n\nThe exponent shift follows Michail Karatarakis's formalization of Baker's theorem in\n`mkaratarakis/mathlib4`, commit `1d51891b5be7ceeca95b4583cad39e0681c5e453`,\n`Mathlib/NumberTheory/Transcendental/Baker/CoordinateDivision.lean` (Apache 2.0).\n-/\n\npublic section\n\nopen Finset Topology\nopen scoped NNReal ENNReal\n\nvariable {\ud835\udd5c \u03b9 F : Type*} [NontriviallyNormedField \ud835\udd5c] [Fintype \u03b9]\n [NormedAddCommGroup F] [NormedSpace \ud835\udd5c F]\n\nnamespace TauCeti\n\n/-- For a complete target, suppose the expansion of `f` at `x` has weighted norm summability\nat every positive finite radius smaller than `r` and vanishes outside the upper cone of `shift`.\nThen there is a quotient `g` analytic on the zero-centred open polydisc of radius `r`,\nwith `f (x + y) = (\u220f j, y j ^ shift j) \u2022 g y` there. The radius `r` may be infinite. -/\ntheorem exists_analyticOnNhd_eq_prod_pow_smul [CompleteSpace F] {f : (\u03b9 \u2192 \ud835\udd5c) \u2192 F}\n {x : \u03b9 \u2192 \ud835\udd5c} {c : (\u03b9 \u2192 \u2115) \u2192 F} {r : \u211d\u22650\u221e}\n (hc : \u2200 s : \u211d\u22650, 0 < s \u2192 s < r \u2192\n Summable fun \u03b1 : \u03b9 \u2192 \u2115 \u21a6 \u2016c \u03b1\u2016 * (s : \u211d) ^ (\u2211 j, \u03b1 j))\n (hf : \u2200 y : \u03b9 \u2192 \ud835\udd5c, y \u2208 Metric.eball 0 r \u2192\n HasSum (fun \u03b1 : \u03b9 \u2192 \u2115 \u21a6 (\u220f j, y j ^ \u03b1 j) \u2022 c \u03b1) (f (x + y)))\n (shift : \u03b9 \u2192 \u2115) (hzero : \u2200 \u03b1, \u00ac shift \u2264 \u03b1 \u2192 c \u03b1 = 0) :\n \u2203 g : (\u03b9 \u2192 \ud835\udd5c) \u2192 F, AnalyticOnNhd \ud835\udd5c g (Metric.eball 0 r) \u2227\n \u2200 y \u2208 Metric.eball (0 : \u03b9 \u2192 \ud835\udd5c) r, f (x + y) = (\u220f j, y j ^ shift j) \u2022 g y := by\n let d : (\u03b9 \u2192 \u2115) \u2192 F := fun \u03b1 \u21a6 c (\u03b1 + shift)\n let g : (\u03b9 \u2192 \ud835\udd5c) \u2192 F := fun y \u21a6 \u2211' \u03b1 : \u03b9 \u2192 \u2115, (\u220f j, y j ^ \u03b1 j) \u2022 d \u03b1\n have hpoint (y : \u03b9 \u2192 \ud835\udd5c) (hy : y \u2208 Metric.eball 0 r) :\n AnalyticAt \ud835\udd5c g y \u2227 HasSum (fun \u03b1 : \u03b9 \u2192 \u2115 \u21a6 (\u220f j, y j ^ \u03b1 j) \u2022 d \u03b1) (g y) := by\n obtain \u27e8s, hys, hsr\u27e9 := ENNReal.lt_iff_exists_nnreal_btwn.1 (mem_eball_zero_iff.1 hy)\n have hs : 0 < s := ENNReal.coe_pos.1 (zero_le.trans_lt hys)\n have hd := summable_norm_shift (NNReal.coe_pos.mpr hs) shift (hc s hs hsr)\n have hyball : y \u2208 Metric.eball 0 (s : \u211d\u22650\u221e) := mem_eball_zero_iff.2 hys\n have hnorm : \u2016y\u2016 < (s : \u211d) := by\n simpa only [Metric.eball_coe, mem_ball_zero_iff] using hyball\n have hsum (z : \u03b9 \u2192 \ud835\udd5c) (hz : \u2016z\u2016 < (s : \u211d)) :\n HasSum (fun \u03b1 : \u03b9 \u2192 \u2115 \u21a6 (\u220f j, z j ^ \u03b1 j) \u2022 d \u03b1) (g z) :=\n (summable_norm_prod_pow_smul_of_le hd hz.le).of_norm.hasSum\n obtain \u27e8p, hp, -\u27e9 := exists_hasFPowerSeriesOnBall_of_hasSum (\ud835\udd5c := \ud835\udd5c)\n (f := g) (x := 0) hs hd (fun z hz \u21a6 by simpa only [zero_add] using hsum z hz)\n exact \u27e8hp.analyticAt_of_mem hyball, hsum y hnorm\u27e9\n refine \u27e8g, fun y hy \u21a6 (hpoint y hy).1, fun y hy \u21a6 (hf y hy).unique ?_\u27e9\n exact hasSum_monomial_shift shift hzero (hpoint y hy).2\n\n/-- For a complete target, suppose the expansion of `f` at `x` has weighted norm summability\nat every positive finite radius smaller than `r` and no terms of degree less than `m` in coordinate\n`i`. Then there is a quotient `g` analytic on the zero-centred open polydisc of radius `r`,\nwith `f (x + y) = y i ^ m \u2022 g y` there. The radius `r` may be infinite. -/\ntheorem exists_analyticOnNhd_eq_coord_pow_smul [CompleteSpace F] {f : (\u03b9 \u2192 \ud835\udd5c) \u2192 F}\n {x : \u03b9 \u2192 \ud835\udd5c} {c : (\u03b9 \u2192 \u2115) \u2192 F} {r : \u211d\u22650\u221e}\n (hc : \u2200 s : \u211d\u22650, 0 < s \u2192 s < r \u2192\n Summable fun \u03b1 : \u03b9 \u2192 \u2115 \u21a6 \u2016c \u03b1\u2016 * (s : \u211d) ^ (\u2211 j, \u03b1 j))\n (hf : \u2200 y : \u03b9 \u2192 \ud835\udd5c, y \u2208 Metric.eball 0 r \u2192\n HasSum (fun \u03b1 : \u03b9 \u2192 \u2115 \u21a6 (\u220f j, y j ^ \u03b1 j) \u2022 c \u03b1) (f (x + y)))\n (i : \u03b9) (m : \u2115) (hzero : \u2200 \u03b1, \u03b1 i < m \u2192 c \u03b1 = 0) :\n \u2203 g : (\u03b9 \u2192 \ud835\udd5c) \u2192 F, AnalyticOnNhd \ud835\udd5c g (Metric.eball 0 r) \u2227\n \u2200 y \u2208 Metric.eball (0 : \u03b9 \u2192 \ud835\udd5c) r, f (x + y) = y i ^ m \u2022 g y := by\n classical\n have hcone (\u03b1 : \u03b9 \u2192 \u2115) (h\u03b1 : \u00ac Pi.single i m \u2264 \u03b1) : c \u03b1 = 0 := by\n apply hzero \u03b1\n simpa only [Pi.single_le_iff, not_le] using h\u03b1\n simpa only [Fintype.prod_pow_pi_single] using\n exists_analyticOnNhd_eq_prod_pow_smul hc hf (Pi.single i m) hcone\n\nend TauCeti\n\n", "statement": "/-- For a complete target and a function analytic at `x`, vanishing of Taylor coefficients\noutside the upper cone of `shift` gives an analytic factor after removing the monomial\n`\u220f j, (z j - x j) ^ shift j` near the centre `x`. -/\ntheorem AnalyticAt.exists_eventuallyEq_prod_sub_pow_smul [CompleteSpace F]\n {f : (\u03b9 \u2192 \ud835\udd5c) \u2192 F} {x : \u03b9 \u2192 \ud835\udd5c} (hf : AnalyticAt \ud835\udd5c f x) (shift : \u03b9 \u2192 \u2115)\n (hzero : \u2200 \u03b1 : \u03b9 \u2192 \u2115, \u00ac shift \u2264 \u03b1 \u2192 TauCeti.mvTaylorCoeff f x \u03b1 = 0) :\n \u2203 g : (\u03b9 \u2192 \ud835\udd5c) \u2192 F, AnalyticAt \ud835\udd5c g x \u2227\n f =\u1da0[\ud835\udcdd x] fun z \u21a6 (\u220f j, (z j - x j) ^ shift j) \u2022 g z ", "proof": " by\n obtain \u27e8r, hr, hc, hsum\u27e9 := hf.exists_hasSum_mvTaylorCoeff\n have hc' (s : \u211d\u22650) (hsr : s < r) :\n Summable fun \u03b1 : \u03b9 \u2192 \u2115 \u21a6\n \u2016TauCeti.mvTaylorCoeff f x \u03b1\u2016 * (s : \u211d) ^ (\u2211 j, \u03b1 j) :=\n TauCeti.summable_mul_pow_of_le (fun _ \u21a6 norm_nonneg _) hsr.le hc\n have hsum' (y : \u03b9 \u2192 \ud835\udd5c) (hy : y \u2208 Metric.eball 0 (r : \u211d\u22650\u221e)) :=\n hsum y (by simpa only [Metric.eball_coe, mem_ball_zero_iff] using hy)\n obtain \u27e8g, hg, hfg\u27e9 := TauCeti.exists_analyticOnNhd_eq_prod_pow_smul\n (r := r) (fun s _ hsr \u21a6 hc' s (ENNReal.coe_lt_coe.1 hsr)) hsum' shift hzero\n refine \u27e8fun z \u21a6 g (z - x), ?_, ?_\u27e9\n \u00b7 simpa only [zero_add] using\n (hg 0 (Metric.mem_eball_self (ENNReal.coe_pos.2 hr))).comp_sub x\n \u00b7 filter_upwards [Metric.ball_mem_nhds x (NNReal.coe_pos.mpr hr)] with z hz\n simpa only [add_sub_cancel, Pi.sub_apply] using hfg (z - x)\n (by simpa only [Metric.eball_coe, Metric.mem_ball, dist_eq_norm, sub_zero] using hz)", "proof_lines": 15, "proof_length": 871, "rev": "75c8aed5fea63047615a25a9763fd5b68a86e891", "heartbeats": 1273, "image": "lean-compression:tauceti-75c8aed5fe-a608030cfc", "split": "dev"} {"path": "TauCeti/Topology/MetricSpace/Arclength/SimpleClosed.lean", "module": "TauCeti.Topology.MetricSpace.Arclength.SimpleClosed", "theorem": "BoundedVariationOn.exists_simple_closed_arclength_parametrization", "prefix": "/-\nCopyright (c) 2026 The Tau Ceti contributors. All rights reserved.\nReleased under Apache 2.0 license as described in the file LICENSE.\nAuthors: The Tau Ceti contributors\n-/\nmodule\n\npublic import TauCeti.Topology.MetricSpace.Arclength.Basic\npublic import TauCeti.Analysis.ConstantSpeed\n\n/-!\n# Arclength parametrization of simple closed curves\n\nA continuous rectifiable curve with equal endpoint values and no repetitions on the half-open\nparameter interval has an arclength parametrization with exactly the same simplicity property.\nThe parametrization is 1-Lipschitz, has unit variation speed, and traces the original image.\nThe repetition characterization includes the zero-length case: its length interval is a\nsingleton. Values outside the length interval are unspecified.\n\nTogether with the increasing arclength homeomorphism, this permits transporting geometric\nconstructions on simple closed curves to a Lipschitz parameter without losing their orientation\nor introducing repeated points.\n\nThe construction uses Mathlib's `naturalParameterization` and its unit-speed theorem,\ntogether with `HasConstantSpeedOnWith.lipschitzOnWith`; there is no additional curve or\nlength carrier.\n\n## References\n\n* L. Ambrosio, N. Gigli, G. Savar\u00e9, *Gradient Flows*, second edition, \u00a71.1\n (arclength parametrization of metric curves).\n-/\n\npublic section\n\nopen Set\nopen scoped ENNReal\n\nnamespace BoundedVariationOn\n\nvariable {X : Type*} [MetricSpace X] {\u03b3 : \u211d \u2192 X} {a b : \u211d}\n\n/-- Half-open injectivity of a continuous rectifiable curve passes to its natural\nparameterization on `[0, L)`. -/\ntheorem injOn_naturalParameterization_Ico\n (h\u03b3 : BoundedVariationOn \u03b3 (Icc a b)) (hcont : ContinuousOn \u03b3 (Icc a b))\n (hinj : InjOn \u03b3 (Ico a b)) (hab : a \u2264 b) :\n InjOn (naturalParameterization \u03b3 (Icc a b) a)\n (Ico 0 (eVariationOn \u03b3 (Icc a b)).toReal) := by\n let s := variationOnFromTo \u03b3 (Icc a b) a\n have ha : a \u2208 Icc a b := left_mem_Icc.mpr hab\n have hs : ContinuousOn s (Icc a b) := fun t ht \u21a6\n (h\u03b3.continuousWithinAt_variationOnFromTo_iff ha ht).mpr (hcont t ht)\n have hm : StrictMonoOn s (Icc a b) :=\n h\u03b3.locallyBoundedVariationOn.strictMonoOn_variationOnFromTo_of_injOn_Ioo\n (hinj.mono Ioo_subset_Ico_self)\n have himageco : s '' Ico a b = Ico 0 (eVariationOn \u03b3 (Icc a b)).toReal := by\n rw [hs.image_Ico_of_strictMonoOn hab hm]\n simp only [s, variationOnFromTo.self, variationOnFromTo.eq_of_le _ _ hab, inter_self]\n have hfactor : EqOn (naturalParameterization \u03b3 (Icc a b) a \u2218 s) \u03b3 (Ico a b) := fun t ht \u21a6\n h\u03b3.locallyBoundedVariationOn.naturalParameterization_variationOnFromTo ha\n (Ico_subset_Icc_self ht)\n rw [\u2190 himageco]\n exact (hinj.congr hfactor.symm).image_of_comp\n\n", "statement": "/-- A rectifiable simple closed curve admits a unit-speed Lipschitz arclength parametrization.\nThe endpoints are preserved, the trace is unchanged, and equality of two values occurs exactly\nat equal parameters or at the two endpoints. The statement also holds on a singleton interval.\n-/\ntheorem exists_simple_closed_arclength_parametrization\n (h\u03b3 : BoundedVariationOn \u03b3 (Icc a b)) (hcont : ContinuousOn \u03b3 (Icc a b))\n (hinj : InjOn \u03b3 (Ico a b)) (hclosed : \u03b3 a = \u03b3 b) (hab : a \u2264 b) :\n \u2203 g : \u211d \u2192 X,\n LipschitzOnWith 1 g (Icc 0 (eVariationOn \u03b3 (Icc a b)).toReal) \u2227\n HasUnitSpeedOn g (Icc 0 (eVariationOn \u03b3 (Icc a b)).toReal) \u2227\n EqOn (g \u2218 variationOnFromTo \u03b3 (Icc a b) a) \u03b3 (Icc a b) \u2227\n g 0 = \u03b3 a \u2227 g (eVariationOn \u03b3 (Icc a b)).toReal = \u03b3 b \u2227\n g '' Icc 0 (eVariationOn \u03b3 (Icc a b)).toReal = \u03b3 '' Icc a b \u2227\n \u2200 u \u2208 Icc 0 (eVariationOn \u03b3 (Icc a b)).toReal,\n \u2200 v \u2208 Icc 0 (eVariationOn \u03b3 (Icc a b)).toReal,\n g u = g v \u2194 u = v \u2228\n (u = 0 \u2227 v = (eVariationOn \u03b3 (Icc a b)).toReal) \u2228\n (u = (eVariationOn \u03b3 (Icc a b)).toReal \u2227 v = 0) ", "proof": " by\n let s := variationOnFromTo \u03b3 (Icc a b) a\n let L := (eVariationOn \u03b3 (Icc a b)).toReal\n have ha : a \u2208 Icc a b := left_mem_Icc.mpr hab\n have himage : s '' Icc a b = Icc 0 L := h\u03b3.image_variationOnFromTo_Icc hcont hab\n let g := naturalParameterization \u03b3 (Icc a b) a\n have hunit : HasUnitSpeedOn g (Icc 0 L) := by\n rw [\u2190 himage]\n exact has_unit_speed_naturalParameterization \u03b3 h\u03b3.locallyBoundedVariationOn ha\n have hg : LipschitzOnWith 1 g (Icc 0 L) := hunit.lipschitzOnWith\n have hfactor : EqOn (g \u2218 s) \u03b3 (Icc a b) := fun t ht \u21a6\n h\u03b3.locallyBoundedVariationOn.naturalParameterization_variationOnFromTo ha ht\n have hg0 : g 0 = \u03b3 a := h\u03b3.locallyBoundedVariationOn.naturalParameterization_zero ha\n have hgL : g L = \u03b3 b := h\u03b3.naturalParameterization_toReal_eVariationOn hab\n have hgclosed : g 0 = g L := hg0.trans (hclosed.trans hgL.symm)\n have hginj : InjOn g (Ico 0 L) := h\u03b3.injOn_naturalParameterization_Ico hcont hinj hab\n have htrace : g '' Icc 0 L = \u03b3 '' Icc a b := h\u03b3.image_naturalParameterization_Icc hcont hab\n refine \u27e8g, hg, hunit, hfactor, hg0, hgL, htrace, ?_\u27e9\n -- The right endpoint is the only parameter omitted by half-open injectivity.\n -- Separating it out also handles a length interval consisting of one point.\n intro u hu v hv\n constructor\n \u00b7 intro huv\n by_cases huL : u = L\n \u00b7 by_cases hvL : v = L\n \u00b7 exact Or.inl (huL.trans hvL.symm)\n \u00b7 have hvco : v \u2208 Ico 0 L := \u27e8hv.1, lt_of_le_of_ne hv.2 hvL\u27e9\n have h0co : 0 \u2208 Ico 0 L := \u27e8le_rfl, hv.1.trans_lt hvco.2\u27e9\n have hv0 : v = 0 := hginj hvco h0co (by simpa [huL, hgclosed] using huv.symm)\n exact Or.inr (Or.inr \u27e8huL, hv0\u27e9)\n \u00b7 have huco : u \u2208 Ico 0 L := \u27e8hu.1, lt_of_le_of_ne hu.2 huL\u27e9\n by_cases hvL : v = L\n \u00b7 have h0co : 0 \u2208 Ico 0 L := \u27e8le_rfl, hu.1.trans_lt huco.2\u27e9\n have hu0 : u = 0 := hginj huco h0co (by simpa [hvL, hgclosed] using huv)\n exact Or.inr (Or.inl \u27e8hu0, hvL\u27e9)\n \u00b7 exact Or.inl (hginj huco \u27e8hv.1, lt_of_le_of_ne hv.2 hvL\u27e9 huv)\n \u00b7 rintro (rfl | \u27e8rfl, rfl\u27e9 | \u27e8rfl, rfl\u27e9)\n \u00b7 rfl\n \u00b7 exact hgclosed\n \u00b7 exact hgclosed.symm", "proof_lines": 39, "proof_length": 1798, "rev": "75c8aed5fea63047615a25a9763fd5b68a86e891", "heartbeats": 639, "image": "lean-compression:tauceti-75c8aed5fe-a608030cfc", "split": "dev"} {"path": "TauCeti/Topology/Sheaves/LocalCohomology/Module.lean", "module": "TauCeti.Topology.Sheaves.LocalCohomology.Module", "theorem": "CategoryTheory.Sheaf.supportedModuleHSheafZeroIso_hom_naturality", "prefix": "/-\nCopyright (c) 2026 The Tau Ceti contributors. All rights reserved.\nReleased under Apache 2.0 license as described in the file LICENSE.\nAuthors: The Tau Ceti contributors\n-/\nmodule\n\npublic import TauCeti.Topology.Sheaves.SupportedCohomology.Sections\nimport TauCeti.Topology.Sheaves.Stalks\n\n/-!\n# Local cohomology sheaves with module coefficients\n\nSheafifying the module-valued presheaf `W \u21a6 Ext\u207f(Q_S(W), F)` defines the local\ncohomology sheaf `\ud835\udcd7_S\u207f(F)`. In degree zero this is canonically the supported-section\nsheaf `\u0393_S(F)`, naturally in the coefficient sheaf. Local cohomology has zero stalks\noutside `S`, and `\ud835\udcd7_S\u207f(F)` vanishes exactly when every class in `H_S\u207f(W, F)` vanishes\nlocally. These constructions keep the scalar action on local cohomology, rather\nthan replacing its coefficients by abelian groups.\n\n## References\n\n* A. Grothendieck, *Local cohomology*, Lecture Notes in Mathematics 41, \u00a71.\n* M. Kashiwara and P. Schapira, *Sheaves on Manifolds*, \u00a72.3 and \u00a72.6.\n-/\n\npublic section\n\nopen CategoryTheory Limits Opposite TopologicalSpace\n\nuniverse u\n\nnamespace CategoryTheory.Sheaf\n\nvariable {X : TopCat.{u}} {R : Type u} [CommRing R]\n (F : Sheaf (Opens.grothendieckTopology X) (ModuleCat.{u} R)) (S : Closeds X)\n\nnoncomputable section\n\n/-- The local cohomology sheaf `\ud835\udcd7_S\u207f(F)`, defined by sheafifying the module-valued supported\ncohomology presheaf. -/\nabbrev supportedModuleHSheaf (n : \u2115) : Sheaf (Opens.grothendieckTopology X) (ModuleCat.{u} R) :=\n (presheafToSheaf (Opens.grothendieckTopology X) (ModuleCat.{u} R)).obj\n (F.supportedModuleHPresheaf S n)\n\n/-- The functor of module-valued local cohomology in degree `n`.\n\nThe body is exposed so its objects are definitionally the local cohomology sheaves;\nits action on morphisms is characterized by `supportedModuleHPresheafFunctor_map_toSheafify`. -/\n@[expose]\ndef supportedModuleHSheafFunctor (n : \u2115) :\n Sheaf (Opens.grothendieckTopology X) (ModuleCat.{u} R) \u2964\n Sheaf (Opens.grothendieckTopology X) (ModuleCat.{u} R) :=\n supportedModuleHPresheafFunctor S n \u22d9 presheafToSheaf _ _\n\n@[simp]\nlemma supportedModuleHSheafFunctor_obj (n : \u2115) :\n (supportedModuleHSheafFunctor S n).obj F = F.supportedModuleHSheaf S n :=\n (rfl)\n\n/-- Local cohomology is additive in the coefficient sheaf. -/\ninstance additive_supportedModuleHSheafFunctor (n : \u2115) :\n (supportedModuleHSheafFunctor (R := R) S n).Additive := by\n have : (supportedModuleHPresheafFunctor (R := R) S n).Additive := inferInstance\n have : (presheafToSheaf (Opens.grothendieckTopology X) (ModuleCat.{u} R)).Additive :=\n inferInstance\n exact inferInstanceAs ((supportedModuleHPresheafFunctor (R := R) S n \u22d9\n presheafToSheaf (Opens.grothendieckTopology X) (ModuleCat.{u} R)).Additive)\n\n/-- The local cohomology map is induced by the supported cohomology presheaf map through\nsheafification, in every degree. -/\n@[simp, reassoc]\nlemma supportedModuleHPresheafFunctor_map_toSheafify (n : \u2115)\n {F G : Sheaf (Opens.grothendieckTopology X) (ModuleCat.{u} R)} (f : F \u27f6 G) :\n (supportedModuleHPresheafFunctor S n).map f \u226b\n toSheafify (Opens.grothendieckTopology X) (G.supportedModuleHPresheaf S n) =\n toSheafify (Opens.grothendieckTopology X) (F.supportedModuleHPresheaf S n) \u226b\n ((supportedModuleHSheafFunctor S n).map f).hom :=\n toSheafify_naturality _ _\n\n/-- The degree-zero local cohomology sheaf is the sheaf of supported sections. -/\ndef supportedModuleHSheafZeroIso : F.supportedModuleHSheaf S 0 \u2245 F.supportedSubmoduleSheaf S :=\n (presheafToSheaf _ _).mapIso (F.supportedModuleHPresheafZeroIso S) \u226a\u226b\n (sheafificationIso (F.supportedSubmoduleSheaf S)).symm\n\n/-- The degree-zero comparison is induced by the sectionwise Ext-Hom equivalences through the\ncanonical sheafification map. -/\n@[reassoc (attr := simp)]\nlemma toSheafify_supportedModuleHSheafZeroIso_hom :\n toSheafify (Opens.grothendieckTopology X) (F.supportedModuleHPresheaf S 0) \u226b\n (F.supportedModuleHSheafZeroIso S).hom.hom =\n (F.supportedModuleHPresheafZeroIso S).hom := by\n simp [supportedModuleHSheafZeroIso]\n\n", "statement": "/-- The degree-zero comparison is natural in the coefficient sheaf. -/\n@[reassoc]\nlemma supportedModuleHSheafZeroIso_hom_naturality\n {F G : Sheaf (Opens.grothendieckTopology X) (ModuleCat.{u} R)} (f : F \u27f6 G) :\n (supportedModuleHSheafFunctor S 0).map f \u226b (G.supportedModuleHSheafZeroIso S).hom =\n (F.supportedModuleHSheafZeroIso S).hom \u226b (supportedSubmoduleFunctor S).map f ", "proof": " by\n let \u03b1 : F.supportedModuleHPresheaf S 0 \u27f6 G.supportedModuleHPresheaf S 0 :=\n (supportedModuleHPresheafFunctor S 0).map f\n let \u03b2 : F.supportedSubmoduleSheaf S \u27f6 G.supportedSubmoduleSheaf S :=\n (supportedSubmoduleFunctor S).map f\n -- Give the maps their concrete source objects before using sheafification's\n -- universal property; the functor object identifications are definitional.\n change (presheafToSheaf _ _).map \u03b1 \u226b (G.supportedModuleHSheafZeroIso S).hom =\n (F.supportedModuleHSheafZeroIso S).hom \u226b \u03b2\n apply Sheaf.hom_ext\n apply sheafify_hom_ext _ _ _ (G.supportedSubmoduleSheaf S).property\n -- Normalize the source objects and the forgetful functor's composition to\n -- apply the unit's naturality without unfolding the comparison isomorphisms.\n change toSheafify _ (F.supportedModuleHPresheaf S 0) \u226b\n ((presheafToSheaf _ _).map \u03b1).hom \u226b (G.supportedModuleHSheafZeroIso S).hom.hom =\n toSheafify _ (F.supportedModuleHPresheaf S 0) \u226b\n (F.supportedModuleHSheafZeroIso S).hom.hom \u226b \u03b2.hom\n rw [\u2190 Category.assoc, \u2190 toSheafify_naturality]\n simp only [Category.assoc, toSheafify_supportedModuleHSheafZeroIso_hom,\n toSheafify_supportedModuleHSheafZeroIso_hom_assoc]\n exact supportedModuleHPresheafZeroIso_hom_naturality S f", "proof_lines": 20, "proof_length": 897, "rev": "75c8aed5fea63047615a25a9763fd5b68a86e891", "heartbeats": 1022, "image": "lean-compression:tauceti-75c8aed5fe-a608030cfc", "split": "dev"} {"path": "TauCeti/Algebra/Homology/HomotopyCategory/MappingCocone/Relative.lean", "module": "TauCeti.Algebra.Homology.HomotopyCategory.MappingCocone.Relative", "theorem": "CochainComplex.mappingCocone.relativeCoordinates_map", "prefix": "/-\nCopyright (c) 2026 The Tau Ceti contributors. All rights reserved.\nReleased under Apache 2.0 license as described in the file LICENSE.\nAuthors: The Tau Ceti contributors\n-/\nmodule\n\npublic import TauCeti.Algebra.Homology.HomotopyCategory.MappingCocone.Basic\npublic import TauCeti.Algebra.Homology.ModuleCat.HomotopyCofiber\n\n/-!\n# Relative coordinates on the shifted mapping cone\n\nFor a morphism `f : K \u27f6 L` of complexes of modules, relative cochains in degree `p`\nare pairs in `K.X p \u00d7 L.X (p - 1)`, with differential\n`(a, b) \u21a6 (d a, f a - d b)`. They are coordinates on Mathlib's actual\n`mappingCocone f = (mappingCone f)\u27e6-1\u27e7`, obtained by negating its second projection.\nThus relative cocycles and coboundaries can be used with the native homology and\nderived-category constructions, without introducing another complex carrier.\n\n`relativeCoordinates` gives the degreewise linear equivalence. The differential,\ncycle and boundary formulas fix its signs, and `relativeCoordinates_map` proves\ncompatibility with maps of pairs. In particular these formulas apply to restriction\nmaps between complexes of differential forms, where relative cocycles satisfy\n`d a = 0` and `f a = d b`.\n\nThe construction reuses `HomologicalComplex.homotopyCofiber.XEquiv` and the\nprojections and inclusions of Mathlib's\n`CochainComplex.mappingCocone`, and the component and naturality lemmas in\n`TauCeti.Algebra.Homology.HomotopyCategory.MappingCocone.Basic`.\n\n## References\n\n* N. Honda, T. Izawa and T. Suwa, *Sato hyperfunctions via relative Dolbeault\n cohomology*, relative cochain convention.\n-/\n\npublic section\n\nopen CategoryTheory Limits HomologicalComplex\n\nuniverse u v\n\nnamespace CochainComplex.mappingCocone\n\nopen HomComplex\n\nvariable {R : Type u} [Ring R] {K L : CochainComplex (ModuleCat.{v} R) \u2124} (f : K \u27f6 L)\n\nnoncomputable section\n\n/-- Relative cochain coordinates on the native shifted cone. The second coordinate is\nthe negative of `mappingCocone.snd`, so the differential has positive restriction term. -/\ndef relativeCoordinates (p q : \u2124) (hpq : p + -1 = q) :\n (mappingCocone f).X p \u2243\u2097[R] K.X p \u00d7 L.X q := by\n subst hpq\n exact (homotopyCofiber.XEquiv f (by simp : (ComplexShape.up \u2124).Rel (p + -1) p)).trans\n ((LinearEquiv.prodComm R _ _).trans\n ((LinearEquiv.refl R _).prodCongr (LinearEquiv.neg R)))\n\nlemma relativeCoordinates_apply (p q : \u2124) (hpq : p + -1 = q) (x : (mappingCocone f).X p) :\n relativeCoordinates f p q hpq x = ((fst f).f p x, -(snd f).v p q hpq x) := by\n subst hpq\n rw [fst_f, snd_v]\n exact congrArg (fun y : L.X (p + -1) \u00d7 K.X p \u21a6 (y.2, -y.1))\n (homotopyCofiber.XEquiv_apply f (by simp : (ComplexShape.up \u2124).Rel (p + -1) p) x)\n\nlemma relativeCoordinates_symm_apply (p q : \u2124) (hpq : p + -1 = q) (x : K.X p \u00d7 L.X q) :\n (relativeCoordinates f p q hpq).symm x = (inl f).v p p (add_zero p) x.1 -\n (inr f).val.v q p (by omega) x.2 := by\n apply (relativeCoordinates f p q hpq).injective\n rw [LinearEquiv.apply_symm_apply, relativeCoordinates_apply]\n ext <;> simp [\u2190 ModuleCat.comp_apply]\n\n/-- In relative coordinates the inclusion `inl f` of `K` is `a \u21a6 (a, 0)`. -/\n@[simp]\nlemma relativeCoordinates_inl_v (p q : \u2124) (hpq : p + -1 = q) (a : K.X p) :\n relativeCoordinates f p q hpq ((inl f).v p p (add_zero p) a) = (a, 0) := by\n rw [relativeCoordinates_apply]\n ext <;> simp [\u2190 ModuleCat.comp_apply]\n\n/-- In relative coordinates the inclusion `inr f` of `L` is `b \u21a6 (0, -b)`. So the class of the\ncocycle `inr b` is `-[(0, b)]`, the connecting map of the relative complex; see\n`CochainComplex.mappingCocone.\u03b4_comp_homologyMap_lift` for its comparison with the connecting\nmap of a short exact sequence. -/\n@[simp]\nlemma relativeCoordinates_inr_v (p q : \u2124) (hpq : p + -1 = q) (b : L.X q) :\n relativeCoordinates f p q hpq ((inr f).val.v q p (by omega) b) = (0, -b) := by\n rw [relativeCoordinates_apply]\n ext <;> simp [\u2190 ModuleCat.comp_apply]\n\n/-- In relative coordinates the shifted cone differential is `(a, b) \u21a6 (d a, f a - d b)`. -/\nlemma relativeCoordinates_d (p q : \u2124) (hpq : p + -1 = q)\n (x : (mappingCocone f).X p) :\n relativeCoordinates f (p + 1) p (by omega) ((mappingCocone f).d p (p + 1) x) =\n (K.d p (p + 1) (relativeCoordinates f p q hpq x).1,\n f.f p (relativeCoordinates f p q hpq x).1 -\n L.d q p (relativeCoordinates f p q hpq x).2) := by\n subst hpq\n simp only [relativeCoordinates_apply]\n apply Prod.ext\n \u00b7 exact congrArg (fun g : (mappingCocone f).X p \u27f6 K.X (p + 1) \u21a6 g x)\n ((fst f).comm p (p + 1)).symm\n \u00b7 have h := congrArg (fun g : (mappingCocone f).X p \u27f6 L.X p \u21a6 g x) (d_snd_v f p)\n simp only [ModuleCat.hom_sub, LinearMap.sub_apply, ModuleCat.comp_apply,\n ModuleCat.hom_neg, LinearMap.neg_apply] at h\n simpa [relativeCoordinates_apply, sub_eq_add_neg, add_comm] using congrArg Neg.neg h\n\n/-- The differential of a pair inserted into the native shifted cone. -/\n@[simp]\nlemma d_relativeCoordinates_symm (p q : \u2124) (hpq : p + -1 = q) (x : K.X p \u00d7 L.X q) :\n (mappingCocone f).d p (p + 1) ((relativeCoordinates f p q hpq).symm x) =\n (relativeCoordinates f (p + 1) p (by omega)).symm\n (K.d p (p + 1) x.1, f.f p x.1 - L.d q p x.2) := by\n apply (relativeCoordinates f (p + 1) p (by omega)).injective\n simp only [relativeCoordinates_d f p q hpq, LinearEquiv.apply_symm_apply]\n\n/-- A relative pair is a cocycle exactly when its first component is closed and\nits restriction is the differential of the second component. -/\nlemma d_relativeCoordinates_symm_eq_zero_iff (p q : \u2124) (hpq : p + -1 = q)\n (x : K.X p \u00d7 L.X q) :\n (mappingCocone f).d p (p + 1) ((relativeCoordinates f p q hpq).symm x) = 0 \u2194\n K.d p (p + 1) x.1 = 0 \u2227 f.f p x.1 = L.d q p x.2 := by\n rw [d_relativeCoordinates_symm]\n rw [\u2190 (relativeCoordinates f (p + 1) p (by omega)).symm.map_zero,\n (relativeCoordinates f (p + 1) p (by omega)).symm.injective.eq_iff]\n exact Prod.mk_eq_zero.trans (and_congr_right fun _ \u21a6 sub_eq_zero)\n\n/-- Relative coboundaries are precisely the pairs `(d c, f c - d e)`. -/\nlemma relativeCoordinates_symm_mem_range_d_iff (p q r : \u2124)\n (hpq : p + -1 = q) (hqr : q + -1 = r) (x : K.X p \u00d7 L.X q) :\n (relativeCoordinates f p q hpq).symm x \u2208\n LinearMap.range ((mappingCocone f).d q p).hom \u2194\n \u2203 c : K.X q, \u2203 e : L.X r, K.d q p c = x.1 \u2227 f.f q c - L.d r q e = x.2 := by\n obtain rfl : p = q + 1 := by omega\n constructor\n \u00b7 rintro \u27e8y, hy\u27e9\n refine \u27e8(relativeCoordinates f q r hqr y).1,\n (relativeCoordinates f q r hqr y).2, ?_\u27e9\n have h := congrArg (relativeCoordinates f (q + 1) q hpq) hy\n rw [relativeCoordinates_d f q r hqr, LinearEquiv.apply_symm_apply] at h\n exact \u27e8congrArg Prod.fst h, congrArg Prod.snd h\u27e9\n \u00b7 rintro \u27e8c, e, hc, he\u27e9\n refine \u27e8(relativeCoordinates f q r hqr).symm (c, e), ?_\u27e9\n rw [d_relativeCoordinates_symm f q r hqr]\n congr 1\n exact Prod.ext hc he\n\n", "statement": "/-- A map of pairs acts componentwise in relative coordinates. This includes restriction\nand coefficient morphisms whenever they commute with the original map of complexes. -/\n-- Rewrite before `shiftFunctor_map_f'` simplifies the argument.\n@[simp\u2193]\nlemma relativeCoordinates_map {K' L' : CochainComplex (ModuleCat.{v} R) \u2124}\n (f' : K' \u27f6 L') (a : K \u27f6 K') (b : L \u27f6 L') (comm : f \u226b b = a \u226b f')\n (p q : \u2124) (hpq : p + -1 = q) (x : (mappingCocone f).X p) :\n relativeCoordinates f' p q hpq\n (((mappingCone.map f f' a b comm)\u27e6(-1 : \u2124)\u27e7').f p x) =\n (a.f p (relativeCoordinates f p q hpq x).1,\n b.f q (relativeCoordinates f p q hpq x).2) ", "proof": " by\n subst hpq\n rw [relativeCoordinates_apply f' p (p + -1) rfl\n (((mappingCone.map f f' a b comm)\u27e6(-1 : \u2124)\u27e7').f p x), relativeCoordinates_apply]\n apply Prod.ext\n \u00b7 exact congrArg (fun g : (mappingCocone f).X p \u27f6 K'.X p \u21a6 g x)\n (HomologicalComplex.congr_hom\n (shiftFunctor_map_mappingCone_map_comp_fst f f' a b comm) p)\n \u00b7 have h := congrArg (fun g : (mappingCocone f).X p \u27f6 L'.X (p + -1) \u21a6 g x)\n (shiftFunctor_map_mappingCone_map_f_snd_v f f' a b comm p)\n simp only [ModuleCat.comp_apply] at h\n exact (congrArg Neg.neg h).trans (map_neg _ _).symm", "proof_lines": 11, "proof_length": 535, "rev": "75c8aed5fea63047615a25a9763fd5b68a86e891", "heartbeats": 1647, "image": "lean-compression:tauceti-75c8aed5fe-a608030cfc", "split": "dev"} {"path": "TauCeti/Analysis/SpecialFunctions/Hypergeometric/Sums.lean", "module": "TauCeti.Analysis.SpecialFunctions.Hypergeometric.Sums", "theorem": "Complex.hasSum_eulerIntegral_inv", "prefix": "/-\nCopyright (c) 2026 The Tau Ceti contributors. All rights reserved.\nReleased under Apache 2.0 license as described in the file LICENSE.\nAuthors: The Tau Ceti contributors\n-/\nmodule\n\npublic import TauCeti.Analysis.SpecialFunctions.Hypergeometric.EulerIntegral.Basic\nimport Mathlib.LinearAlgebra.Complex.FiniteDimensional\nimport TauCeti.Algebra.Field.LinearFractional\nimport TauCeti.Analysis.Analytic.Binomial\nimport TauCeti.Analysis.Analytic.OfScalars\nimport TauCeti.Analysis.Normed.Module.Ball.Exterior\nimport TauCeti.Analysis.SpecialFunctions.Pow.Complex\nimport TauCeti.Analysis.SpecialFunctions.RegularizedHypergeometric.Basic\nimport TauCeti.Analysis.SpecificLimits.Normed\nimport TauCeti.RingTheory.Binomial\nimport TauCeti.RingTheory.Polynomial.Pochhammer\n\n/-!\n# Inverse-argument expansions in Gauss hypergeometric polynomials\n\nClassically, given a nonzero base point `z\u2080 \u2208 \u2102`, the analytically continued regularized Gauss\nhypergeometric function $\\mathbf{F}(a, b, c; z^{-1})$ expands in powers of `(1 - z / z\u2080)\u207b\u00b9` with\nterminating hypergeometric polynomial coefficients `regularizedGaussHGFun (-s) b c z\u2080\u207b\u00b9`\n(DLMF 15.15.1):\n$$\\sum_{s=0}^{\\infty} \\frac{(a)_s}{s!}\\,\\mathbf{F}(-s, b, c; z_0^{-1})\\,(1 - z / z_0)^{-s}\n = (1 - z_0 / z)^a\\,\\mathbf{F}(a, b, c; z^{-1})$$\nfor `max \u2016z\u2080\u2016 \u2016z\u2080 - 1\u2016 < \u2016z - z\u2080\u2016` (equivalently, multiplying the series on the left by\n`(1 - z\u2080 / z) ^ (-a)` as printed in DLMF 15.15.1, since `(1 - z\u2080 / z) ^ (-a)` is the inverse of\n`(1 - z\u2080 / z) ^ a`). In Lean, this identity is proved on the full exterior region\n`max \u2016z\u2080\u2016 \u2016z\u2080 - 1\u2016 < \u2016z - z\u2080\u2016` with `z\u2080 \u2260 0` for `Complex.eulerIntegral` (when `0 < b.re < c.re`),\nand for the power-series functions `Complex.regularizedGaussHGFun` and\n`Complex.ordinaryHypergeometric` (`\u2082F\u2081`, when `\u2200 k : \u2115, c \u2260 -k`) where additionally\n`1 < \u2016z\u2016` (so `\u2016z\u207b\u00b9\u2016 < 1`).\n\nBecause `regularizedGaussHGFun (-s) b c z\u2080\u207b\u00b9` is a polynomial of degree at most `s` in `z\u2080\u207b\u00b9` with\ncoefficients entire in `(b, c)`, its value is well defined at every `z\u2080 \u2260 0` and every `c \u2208 \u2102`,\nincluding when `z\u2080\u207b\u00b9` lies on the branch cut `[1, \u221e)` of the general hypergeometric function or `c`\nis a nonpositive integer. Meanwhile, the exterior condition `max \u2016z\u2080\u2016 \u2016z\u2080 - 1\u2016 < \u2016z - z\u2080\u2016` keeps\n`1 - z\u2080 / z` in the open right half-plane (so the principal power `(1 - z\u2080 / z) ^ a` is analytic)\nand keeps `z\u207b\u00b9` off `[1, \u221e)`.\n\nBuilding on the terminating-polynomial API in\n`TauCeti.Analysis.SpecialFunctions.RegularizedHypergeometric.Basic` and\n`Complex.eulerIntegral_neg_natCast` in\n`TauCeti.Analysis.SpecialFunctions.Hypergeometric.EulerIntegral.Basic`, this file proves that for\nany `z\u2080 \u2260 0` and all complex parameters `a`, `b`, `c`, the DLMF 15.15.1 series converges absolutely\nand defines a holomorphic function throughout `{z | max \u2016z\u2080\u2016 \u2016z\u2080 - 1\u2016 < \u2016z - z\u2080\u2016}`, and\nestablishes the inverse-argument expansion for:\n* `Complex.eulerIntegral` across the full exterior domain `max \u2016z\u2080\u2016 \u2016z\u2080 - 1\u2016 < \u2016z - z\u2080\u2016` with\n `z\u2080 \u2260 0` when `0 < b.re < c.re`;\n* `Complex.regularizedGaussHGFun` at all complex parameters `a`, `b`, `c` whenever `z\u2080 \u2260 0`,\n `1 < \u2016z\u2016`, and `max \u2016z\u2080\u2016 \u2016z\u2080 - 1\u2016 < \u2016z - z\u2080\u2016` (where `1 < \u2016z\u2016` places `z\u207b\u00b9` inside the open\n unit disk of guaranteed power-series convergence for arbitrary parameters);\n* `Complex.ordinaryHypergeometric` (`\u2082F\u2081`) on the same domain when `\u2200 k : \u2115, c \u2260 -k`.\n\n## Main statements\n\n* `Complex.hasSum_eulerIntegral_inv`: DLMF 15.15.1 for `eulerIntegral` on\n `max \u2016z\u2080\u2016 \u2016z\u2080 - 1\u2016 < \u2016z - z\u2080\u2016` with `z\u2080 \u2260 0` when `0 < b.re < c.re`.\n* `Complex.summable_norm_regularizedGaussHGFun_neg_natCast_mul_inv_pow`,\n `Complex.analyticOnNhd_tsum_regularizedGaussHGFun_neg_natCast_mul_inv_pow`: absolute convergence\n and holomorphy of the DLMF 15.15.1 series on `max \u2016z\u2080\u2016 \u2016z\u2080 - 1\u2016 < \u2016z - z\u2080\u2016` with `z\u2080 \u2260 0` for\n all `a`, `b`, `c`.\n* `Complex.hasSum_regularizedGaussHGFun_inv`, `Complex.hasSum_ordinaryHypergeometric_inv`:\n DLMF 15.15.1 for `regularizedGaussHGFun` (all `a`, `b`, `c`) and `\u2082F\u2081` (`\u2200 k : \u2115, c \u2260 -k`) when\n `z\u2080 \u2260 0`, `1 < \u2016z\u2016`, and `max \u2016z\u2080\u2016 \u2016z\u2080 - 1\u2016 < \u2016z - z\u2080\u2016`.\n\n## References\n\n* NIST Digital Library of Mathematical Functions, \u00a715.2 (equation 15.2.4) and \u00a715.15\n (equation 15.15.1).\n* A. Erd\u00e9lyi, W. Magnus, F. Oberhettinger, and F. G. Tricomi, *Higher Transcendental Functions*,\n Vol. I, McGraw\u2013Hill, 1953, \u00a72.5.2.\n-/\n\npublic section\n\nnoncomputable section\n\nopen Complex Filter MeasureTheory Polynomial Set\nopen scoped ENNReal NNReal Nat Topology Interval ComplexConjugate\n\nnamespace Complex\n\n/-! ### DLMF 15.15.1 on the Euler integral range -/\n\nprivate theorem ne_zero_of_norm_lt_norm_sub {z z\u2080 : \u2102} (h : \u2016z\u2080\u2016 < \u2016z - z\u2080\u2016) : z \u2260 0 :=\n fun h0 => h.ne (by simp [h0])\n\nprivate theorem ne_of_norm_lt_norm_sub {z z\u2080 : \u2102} (h : \u2016z\u2080\u2016 < \u2016z - z\u2080\u2016) : z \u2260 z\u2080 :=\n sub_ne_zero.mp (norm_pos_iff.mp ((norm_nonneg z\u2080).trans_lt h))\n\nprivate theorem max_norm_pos_of_ne_zero {z\u2080 : \u2102} (hz\u2080 : z\u2080 \u2260 0) : 0 < max \u2016z\u2080\u2016 \u2016z\u2080 - 1\u2016 :=\n (norm_pos_iff.mpr hz\u2080).trans_le (le_max_left _ _)\n\n/-- For `z\u2080 \u2260 0` and `t \u2208 [0, 1]`, the linear fractional coordinate\n`(1 - z\u2080\u207b\u00b9 * t) * (1 - z / z\u2080)\u207b\u00b9` has norm at most `max \u2016z\u2080\u2016 \u2016z\u2080 - 1\u2016 / \u2016z - z\u2080\u2016`. -/\nprivate theorem norm_one_sub_inv_mul_ofReal_mul_inv_one_sub_div_le_of_mem_Icc {z z\u2080 : \u2102}\n (hz\u2080 : z\u2080 \u2260 0) {t : \u211d} (ht : t \u2208 Set.Icc (0 : \u211d) 1) :\n \u2016(1 - z\u2080\u207b\u00b9 * (t : \u2102)) * (1 - z / z\u2080)\u207b\u00b9\u2016 \u2264 max \u2016z\u2080\u2016 \u2016z\u2080 - 1\u2016 / \u2016z - z\u2080\u2016 := by\n have h : (1 - z\u2080\u207b\u00b9 * (t : \u2102)) * (1 - z / z\u2080)\u207b\u00b9 = (z\u2080 - (t : \u2102)) / (z\u2080 - z) := by\n rw [inv_mul_eq_div, one_sub_div hz\u2080, one_sub_div hz\u2080, inv_div, div_mul_div_cancel\u2080 hz\u2080]\n rw [h, norm_div, norm_sub_rev z\u2080 z]\n exact div_le_div_of_nonneg_right (TauCeti.norm_sub_ofReal_le_max_of_mem_Icc z\u2080 ht)\n (norm_nonneg _)\n\n/-- Pointwise binomial series expansion of the factored Euler kernel on `[0, 1]`. -/\nprivate theorem hasSum_eulerKernel_inv (a : \u2102) {z z\u2080 : \u2102} (hz\u2080 : z\u2080 \u2260 0)\n (hz : max \u2016z\u2080\u2016 \u2016z\u2080 - 1\u2016 < \u2016z - z\u2080\u2016) {t : \u211d} (ht : t \u2208 Icc (0 : \u211d) 1) :\n HasSum (fun s : \u2115 => (ascPochhammer \u2102 s).eval a / s ! *\n ((1 - z\u2080\u207b\u00b9 * (t : \u2102)) * (1 - z / z\u2080)\u207b\u00b9) ^ s)\n ((1 - z\u2080 / z) ^ a * (1 - z\u207b\u00b9 * (t : \u2102)) ^ (-a)) := by\n have h_ext : \u2016z\u2080\u2016 < \u2016z - z\u2080\u2016 := (le_max_left _ _).trans_lt hz\n have hzz\u2080_pos : 0 < \u2016z - z\u2080\u2016 := (norm_nonneg z\u2080).trans_lt h_ext\n have hz_ne : z \u2260 0 := ne_zero_of_norm_lt_norm_sub h_ext\n have hzz\u2080 : z \u2260 z\u2080 := ne_of_norm_lt_norm_sub h_ext\n let vt : \u2102 := (1 - z\u2080\u207b\u00b9 * (t : \u2102)) * (1 - z / z\u2080)\u207b\u00b9\n have hvt_lt : \u2016vt\u2016 < 1 :=\n (norm_one_sub_inv_mul_ofReal_mul_inv_one_sub_div_le_of_mem_Icc hz\u2080 ht).trans_lt\n ((div_lt_one hzz\u2080_pos).mpr hz)\n let w\u2081 : \u2102 := 1 - z\u2080 / z\n have hw\u2081_re : 0 < w\u2081.re := TauCeti.one_sub_div_re_pos h_ext\n have hw\u2081a_ne : w\u2081 ^ a \u2260 0 :=\n Complex.cpow_ne_zero_iff.mpr (Or.inl (Complex.ne_zero_of_re_pos hw\u2081_re))\n have hw\u2082_re : 0 < (1 - vt).re :=\n TauCeti.re_pos_of_norm_sub_one_lt_one (by simpa [sub_sub_cancel_left] using hvt_lt)\n have hprod : w\u2081 * (1 - vt) = 1 - z\u207b\u00b9 * (t : \u2102) :=\n TauCeti.one_sub_div_mul_one_sub_mul_inv_one_sub_div hz_ne hz\u2080 hzz\u2080 (t : \u2102)\n rw [\u2190 hprod, TauCeti.mul_cpow_of_re_pos hw\u2081_re hw\u2082_re (-a), cpow_neg w\u2081 a,\n \u2190 mul_assoc, mul_inv_cancel\u2080 hw\u2081a_ne, one_mul]\n have hbin := TauCeti.hasSum_multichoose_mul_geometric_complex_of_norm_lt_one (r := a) hvt_lt\n rw [one_div, \u2190 cpow_neg] at hbin\n refine hbin.congr_fun fun s => ?_\n rw [TauCeti.Ring.multichoose_eq_inv_factorial_mul_eval_ascPochhammer]\n dsimp only [vt]\n ring\n\n/-- Pointwise norm majorant for the `s`-th Euler integrand term in DLMF 15.15.1. -/\nprivate theorem norm_eulerKernel_inv_term_le (a b c : \u2102) {z z\u2080 : \u2102} (hz\u2080 : z\u2080 \u2260 0)\n {t : \u211d} (ht : t \u2208 Ioc (0 : \u211d) 1) (s : \u2115) :\n \u2016((ascPochhammer \u2102 s).eval a / s ! * ((1 - z / z\u2080)\u207b\u00b9) ^ s) *\n (((t : \u2102) ^ (b - 1) * (1 - (t : \u2102)) ^ (c - b - 1)) *\n (1 - z\u2080\u207b\u00b9 * (t : \u2102)) ^ (-(-(s : \u2102))))\u2016 \u2264\n \u2016(t : \u2102) ^ (b - 1) * (1 - (t : \u2102)) ^ (c - b - 1)\u2016 *\n (Ring.multichoose \u2016a\u2016 s * (max \u2016z\u2080\u2016 \u2016z\u2080 - 1\u2016 / \u2016z - z\u2080\u2016) ^ s) := by\n have hpoch_norm := TauCeti.norm_eval_ascPochhammer_div_factorial_le (w := a) le_rfl s\n let W : \u2102 := (t : \u2102) ^ (b - 1) * (1 - (t : \u2102)) ^ (c - b - 1)\n let vt : \u2102 := (1 - z\u2080\u207b\u00b9 * (t : \u2102)) * (1 - z / z\u2080)\u207b\u00b9\n have h_rearrange : ((ascPochhammer \u2102 s).eval a / s ! * ((1 - z / z\u2080)\u207b\u00b9) ^ s) *\n (W * (1 - z\u2080\u207b\u00b9 * (t : \u2102)) ^ (-(-(s : \u2102)))) =\n W * ((ascPochhammer \u2102 s).eval a / s ! * vt ^ s) := by\n dsimp only [vt]; rw [neg_neg, cpow_natCast, mul_pow]; ring\n rw [h_rearrange, norm_mul W, norm_mul (_ / _), norm_pow]\n gcongr\n exacts [(norm_nonneg _).trans hpoch_norm,\n norm_one_sub_inv_mul_ofReal_mul_inv_one_sub_div_le_of_mem_Icc hz\u2080\n (Ioc_subset_Icc_self ht)]\n\n", "statement": "/-- **Inverse-argument expansion of Euler's hypergeometric integral** (DLMF 15.15.1).\nFor `0 < b.re < c.re`, `z\u2080 \u2260 0`, and `max \u2016z\u2080\u2016 \u2016z\u2080 - 1\u2016 < \u2016z - z\u2080\u2016`, the series in terminating\nGauss polynomials `regularizedGaussHGFun (-s) b c z\u2080\u207b\u00b9` converges to\n`(1 - z\u2080 / z) ^ a * eulerIntegral a b c z\u207b\u00b9`. -/\ntheorem hasSum_eulerIntegral_inv (a : \u2102) {b c z z\u2080 : \u2102} (hb : 0 < b.re) (hbc : b.re < c.re)\n (hz\u2080 : z\u2080 \u2260 0) (hz : max \u2016z\u2080\u2016 \u2016z\u2080 - 1\u2016 < \u2016z - z\u2080\u2016) :\n HasSum (fun s : \u2115 => (ascPochhammer \u2102 s).eval a / s ! *\n regularizedGaussHGFun (-s) b c z\u2080\u207b\u00b9 * ((1 - z / z\u2080)\u207b\u00b9) ^ s)\n ((1 - z\u2080 / z) ^ a * eulerIntegral a b c z\u207b\u00b9) ", "proof": " by\n have hM0 : 0 < max \u2016z\u2080\u2016 \u2016z\u2080 - 1\u2016 := max_norm_pos_of_ne_zero hz\u2080\n have hzz\u2080_pos : 0 < \u2016z - z\u2080\u2016 := hM0.trans hz\n let \u03c1 : \u211d := max \u2016z\u2080\u2016 \u2016z\u2080 - 1\u2016 / \u2016z - z\u2080\u2016\n have h\u03c1_abs : |\u03c1| < 1 := by\n rw [abs_of_nonneg (div_nonneg hM0.le hzz\u2080_pos.le)]\n exact (div_lt_one hzz\u2080_pos).mpr hz\n let W : \u211d \u2192 \u2102 := fun t => (t : \u2102) ^ (b - 1) * (1 - (t : \u2102)) ^ (c - b - 1)\n have hW_int : IntervalIntegrable W volume 0 1 :=\n betaIntegral_convergent hb (by simpa using sub_pos.mpr hbc)\n have hdom_sum : Summable (fun s : \u2115 => Ring.multichoose \u2016a\u2016 s * \u03c1 ^ s) :=\n (TauCeti.hasSum_multichoose_mul_geometric_of_abs_lt_one h\u03c1_abs).summable\n have key := intervalIntegral.hasSum_integral_of_dominated_convergence\n (F := fun (s : \u2115) (t : \u211d) => ((ascPochhammer \u2102 s).eval a / s ! * ((1 - z / z\u2080)\u207b\u00b9) ^ s) *\n (W t * (1 - z\u2080\u207b\u00b9 * (t : \u2102)) ^ (-(-(s : \u2102)))))\n (f := fun t : \u211d => (1 - z\u2080 / z) ^ a * (W t * (1 - z\u207b\u00b9 * (t : \u2102)) ^ (-a)))\n (bound := fun s t => \u2016W t\u2016 * (Ring.multichoose \u2016a\u2016 s * \u03c1 ^ s))\n (a := 0) (b := 1) (\u03bc := volume)\n (fun s => (intervalIntegrable_iff.mp\n ((hW_int.mul_continuousOn (by simp only [neg_neg, cpow_natCast]; fun_prop)).const_mul\n _)).aestronglyMeasurable)\n (fun s => ae_of_all _ fun t ht =>\n norm_eulerKernel_inv_term_le a b c hz\u2080 (uIoc_of_le (zero_le_one' \u211d) \u25b8 ht) s)\n (ae_of_all _ fun t _ => hdom_sum.mul_left \u2016W t\u2016)\n (by simp_rw [tsum_mul_left]; exact hW_int.norm.mul_const _)\n (ae_of_all _ fun t ht => by\n rw [uIoc_of_le zero_le_one] at ht\n convert (hasSum_eulerKernel_inv a hz\u2080 hz (Ioc_subset_Icc_self ht)).mul_left (W t) using 1\n \u00b7 ext s; rw [neg_neg, cpow_natCast, mul_pow]; ring\n \u00b7 ring)\n convert key.mul_left (Gamma b * Gamma (c - b))\u207b\u00b9 using 1\n \u00b7 ext s\n rw [\u2190 eulerIntegral_neg_natCast hb hbc z\u2080\u207b\u00b9 s, eulerIntegral_def,\n intervalIntegral.integral_const_mul]\n ring\n \u00b7 rw [eulerIntegral_def, intervalIntegral.integral_const_mul]\n ring", "proof_lines": 36, "proof_length": 1791, "rev": "75c8aed5fea63047615a25a9763fd5b68a86e891", "heartbeats": 2771, "image": "lean-compression:tauceti-75c8aed5fe-a608030cfc", "split": "dev"} {"path": "TauCeti/Analysis/SpecialFunctions/Hypergeometric/Barnes/Contour.lean", "module": "TauCeti.Analysis.SpecialFunctions.Hypergeometric.Barnes.Contour", "theorem": "Complex.meromorphicAt_hypergeometricMellinBarnesIntegrand", "prefix": "/-\nCopyright (c) 2026 The Tau Ceti contributors. All rights reserved.\nReleased under Apache 2.0 license as described in the file LICENSE.\nAuthors: The Tau Ceti contributors\n-/\nmodule\n\npublic import TauCeti.Analysis.Contour.Residue.Basic\npublic import TauCeti.Analysis.SpecialFunctions.Gamma.Order\npublic import TauCeti.Analysis.SpecialFunctions.Hypergeometric.MellinBarnes\nimport Mathlib.Analysis.Meromorphic.Complex\nimport TauCeti.Analysis.Contour.ConnectorLimit\nimport TauCeti.Analysis.Contour.Residue.ChangeOfVariables\nimport TauCeti.Analysis.Contour.Residue.VerticalLineShift\nimport TauCeti.Analysis.SpecialFunctions.Exp.Bounds\nimport TauCeti.Analysis.SpecialFunctions.Gamma.Residue\nimport TauCeti.Analysis.SpecialFunctions.Gamma.Stirling.Vertical\nimport TauCeti.Analysis.SpecialFunctions.Pow.Complex\nimport TauCeti.MeasureTheory.Integral.Exp.Decay\n\n/-!\n# Barnes's integral over a separating contour\n\nBarnes's integral for the Gauss hypergeometric function\n([DLMF 15.6.6](https://dlmf.nist.gov/15.6.E6)) is\n\n`\ud835\udc05(a, b; c; z) = (2\u03c0i \u0393(a) \u0393(b))\u207b\u00b9 \u222b \u0393(a + t) \u0393(b + t) \u0393(-t) \u0393(c + t)\u207b\u00b9 (-z)^t dt`\n\nover a contour from `-i\u221e` to `i\u221e` that separates the poles `t = -a - k`, `t = -b - k`\n(`k : \u2115`) of `\u0393(a + t) \u0393(b + t)` from the poles `t = 0, 1, 2, \u2026` of `\u0393(-t)`. When `Re a` and\n`Re b` are positive, a vertical line `Re t = \u03c3` with `-min (Re a, Re b) < \u03c3 < 0` is such a\ncontour (`Complex.eulerIntegral_eq_mellinBarnes`). In general no vertical line separates the two\nfamilies, and the contour is the line `Re t = \u03c3` for some `\u03c3 < 0` avoiding the poles, deformed\nto pass to the right of the finitely many poles of `\u0393(a + t) \u0393(b + t)` with real part above `\u03c3`.\nBy the residue theorem its integral is the line integral plus `2\u03c0i` times the residues at those\npoles. This file defines that value and proves that it does not depend on the line. See\n`Barnes/Continuation.lean` for the identification with Euler's integral\n(`Complex.eulerIntegral_eq_hypergeometricMellinBarnes`) and the Gauss hypergeometric series.\n\n## Main definitions\n\n* `Complex.hypergeometricMellinBarnesIntegrand a b c z t`: the integrand\n `\u0393(a + t) \u0393(b + t) \u0393(-t) \u0393(c + t)\u207b\u00b9 (-z)^t` of DLMF 15.6.6.\n* `Complex.hypergeometricMellinBarnes a b c z \u03c3`: the integral `(2\u03c0i)\u207b\u00b9 \u222b_C` over the separating\n contour `C`, written as `(2\u03c0)\u207b\u00b9 \u222b F(\u03c3 + i y) dy` plus the residues of `F` at the poles of\n `\u0393(a + t) \u0393(b + t)` to the right of `Re t = \u03c3`.\n\n## Main results\n\n* `Complex.hypergeometricMellinBarnes_eq`: for `-z \u2208 slitPlane`, the value does not depend on\n the line `Re t = \u03c3`, among lines with `\u03c3 < 0` that avoid the poles of `\u0393(a + t) \u0393(b + t)`.\n This holds for all complex `a`, `b`, `c`.\n* `Complex.residue_hypergeometricMellinBarnesIntegrand_neg_sub_natCast`: the residue at a simple\n pole `t = -a - k` that is not a pole of `\u0393(b + t)` or of `\u0393(-t)`, which is\n `(-1)^k / k! \u00b7 \u0393(b - a - k) \u0393(a + k) \u0393(c - a - k)\u207b\u00b9 (-z)^(-a - k)`.\n* `Complex.residue_hypergeometricMellinBarnesIntegrand_neg_sub_natCast_right`: the corresponding\n residue at `t = -b - k`, obtained by symmetry.\n\n## Implementation notes\n\nThe line shift is `TauCeti.Contour.integral_vertical_sub_eq_two_pi_mul_sum_residue`. Its\nhorizontal connectors vanish by Stirling's bounds on vertical strips\n(`TauCeti.exists_norm_Gamma_add_vertical_strip_le`,\n`TauCeti.exists_norm_inv_Gamma_add_vertical_strip_le`):\non `A \u2264 Re t \u2264 B`, `|Im t| = T`, the integrand is `O((1 + T)^K exp (-(\u03c0 - |arg (-z)|) T))`.\n\n## References\n\n* NIST Digital Library of Mathematical Functions, \u00a715.6,\n [15.6.6](https://dlmf.nist.gov/15.6.E6), and the paragraph following it on the contour.\n* E. T. Whittaker and G. N. Watson, *A Course of Modern Analysis*, \u00a714.5.\n-/\n\npublic section\n\nnoncomputable section\n\nopen Complex Filter MeasureTheory Set\nopen scoped Nat Real Topology\n\nnamespace Complex\n\n/-! ### The integrand and its poles -/\n\n/-- The integrand `\u0393(a + t) \u0393(b + t) \u0393(-t) \u0393(c + t)\u207b\u00b9 (-z)^t` of Barnes's integral for the Gauss\nhypergeometric function (DLMF 15.6.6). -/\ndef hypergeometricMellinBarnesIntegrand (a b c z t : \u2102) : \u2102 :=\n Gamma (a + t) * Gamma (b + t) * Gamma (-t) * (Gamma (c + t))\u207b\u00b9 * (-z) ^ t\n\ntheorem hypergeometricMellinBarnesIntegrand_def (a b c z t : \u2102) :\n hypergeometricMellinBarnesIntegrand a b c z t =\n Gamma (a + t) * Gamma (b + t) * Gamma (-t) * (Gamma (c + t))\u207b\u00b9 * (-z) ^ t := (rfl)\n\ntheorem hypergeometricMellinBarnesIntegrand_comm (a b c z : \u2102) :\n hypergeometricMellinBarnesIntegrand a b c z = hypergeometricMellinBarnesIntegrand b a c z := by\n ext t\n simp only [hypergeometricMellinBarnesIntegrand_def]\n ring\n\n", "statement": "/-- The integrand of Barnes's integral is meromorphic in `t` everywhere. -/\ntheorem meromorphicAt_hypergeometricMellinBarnesIntegrand (a b c z t : \u2102) :\n MeromorphicAt (hypergeometricMellinBarnesIntegrand a b c z) t ", "proof": " by\n have hG (s : \u2102 \u2192 \u2102) (hs : AnalyticAt \u2102 s t) :\n MeromorphicAt (fun t \u21a6 Gamma (s t)) t :=\n (Meromorphic.Gamma (s t)).comp_analyticAt hs\n have hinv : MeromorphicAt (fun t \u21a6 (Gamma (c + t))\u207b\u00b9) t := (hG _ (by fun_prop)).inv\n have hpow : MeromorphicAt (fun t \u21a6 (-z) ^ t) t := by\n rcases eq_or_ne z 0 with rfl | hz\n \u00b7 rcases eq_or_ne t 0 with rfl | ht\n \u00b7 refine (MeromorphicAt.const (0 : \u2102) 0).congr ?_\n filter_upwards [self_mem_nhdsWithin] with s (hs : s \u2260 0)\n simp [zero_cpow hs]\n \u00b7 refine (analyticAt_const (v := (0 : \u2102))).meromorphicAt.congr ?_\n filter_upwards [nhdsWithin_le_nhds (isOpen_ne.mem_nhds ht)] with s (hs : s \u2260 0)\n simp [zero_cpow hs]\n \u00b7 exact ((differentiable_id.const_cpow (.inl (neg_ne_zero.mpr hz))).analyticAt t).meromorphicAt\n exact ((((hG _ (by fun_prop)).mul (hG _ (by fun_prop))).mul (hG _ (by fun_prop))).mul\n hinv).mul hpow", "proof_lines": 16, "proof_length": 831, "rev": "75c8aed5fea63047615a25a9763fd5b68a86e891", "heartbeats": 985, "image": "lean-compression:tauceti-75c8aed5fe-a608030cfc", "split": "dev"} {"path": "TauCeti/Topology/Algebra/Module/LinearPMap/CommonDomain.lean", "module": "TauCeti.Topology.Algebra.Module.LinearPMap.CommonDomain", "theorem": "ContinuousLinearMap.isResolventAt_domainOperator", "prefix": "/-\nCopyright (c) 2026 The Tau Ceti contributors. All rights reserved.\nReleased under Apache 2.0 license as described in the file LICENSE.\nAuthors: The Tau Ceti contributors\n-/\nmodule\n\npublic import Mathlib.Topology.Algebra.Module.ContinuousLinearMap.Invertible\npublic import Mathlib.Topology.Algebra.Module.LinearPMap\npublic import TauCeti.LinearAlgebra.LinearPMap.CommonDomain\npublic import TauCeti.Topology.Algebra.Module.LinearPMap.Resolvent.Compact\nimport TauCeti.Topology.Algebra.Module.ContinuousLinearMap.Invertible\n\n/-!\n# The partial operator of an operator on a common domain\n\nAn unbounded operator on a space `H` is often given, as in the analysis of Floer trajectories, by\na bounded operator `A : D \u2192L H` on a smaller space `D` together with a bounded injective inclusion\n`\u03b9 : D \u2192L H`: the asymptotic operator `J\u2080 (\u2202\u209c - S)` of a Floer cylinder is bounded from `H\u00b9(S\u00b9)`\nto `L\u00b2(S\u00b9)`. Such pairs `(\u03b9, A)` are the input of the trajectory operators\n`TauCeti.WeakDerivStep.domainTrajectoryOperator`. The partial linear operator on `H` with domain\n`range \u03b9`, acting by `\u03b9 x \u21a6 A x`, is `LinearMap.domainOperator` of the underlying linear maps,\n`\u03b9.toLinearMap.domainOperator A.toLinearMap h\u03b9`, whose construction and graph API only use\nlinear maps. This\nfile translates the conditions usually placed on the pair into the native theory of partial\noperators, over topological modules. `A` may take values in a second space `K`, as for the weak\ngradient `TauCeti.weakGradientPMap`. The normed closedness criteria and the characterization of\nthe resolvent set for Banach spaces are in\n`TauCeti.Analysis.Normed.Operator.LinearPMap.CommonDomain`; symmetry and self-adjointness on an\ninner product space are in `TauCeti.Analysis.InnerProductSpace.LinearPMap.CommonDomain`.\n\n* **Graph.** The graph of the partial operator is the range of `x \u21a6 (\u03b9 x, A x)`\n (`LinearMap.graph_domainOperator`), so the operator is closed exactly when that range is\n (`ContinuousLinearMap.isClosed_domainOperator_iff_isClosed_range`).\n* **Resolvent.** If `c \u2022 \u03b9 - A : D \u2192 H` is invertible, `c` is a resolvent point with resolvent\n `\u03b9 \u2218 (c \u2022 \u03b9 - A)\u207b\u00b9` (`ContinuousLinearMap.resolvent_domainOperator`), and at a resolvent point\n the shift `c \u2022 \u03b9 - A` is bijective\n (`ContinuousLinearMap.bijective_smul_sub_of_mem_resolventSet`). If moreover `\u03b9` is a compact\n operator, the partial operator has compact resolvent\n (`ContinuousLinearMap.hasCompactResolvent_domainOperator`). If `A` is invertible, `0` is a\n resolvent point (`ContinuousLinearMap.mem_resolventSet_domainOperator_of_isInvertible`).\n\n## References\n\n* T. Kato, *Perturbation Theory for Linear Operators*, Sections III.5.2 and III.6.8.\n* J. Robbin and D. Salamon, *The spectral flow and the Maslov index*, Bull. London Math. Soc.\n **27** (1995), 1\u201333, Section 4 (paths of self-adjoint operators on a fixed domain `W \u2282 H`).\n-/\n\npublic section\n\nnoncomputable section\n\nopen Function\n\nnamespace ContinuousLinearMap\n\nsection Closed\n\nvariable {R D H K : Type*} [CommRing R] [AddCommGroup D] [Module R D] [TopologicalSpace D]\n [AddCommGroup H] [Module R H] [TopologicalSpace H]\n [AddCommGroup K] [Module R K] [TopologicalSpace K]\n {\u03b9 : D \u2192L[R] H} {A : D \u2192L[R] K} {h\u03b9 : Injective \u03b9}\n\n/-- `LinearMap.domainOperator \u03b9 A h\u03b9` is closed exactly when the range of `x \u21a6 (\u03b9 x, A x)` is\nclosed. -/\ntheorem isClosed_domainOperator_iff_isClosed_range :\n (\u03b9.toLinearMap.domainOperator A.toLinearMap h\u03b9).IsClosed \u2194\n IsClosed (Set.range (\u03b9.prod A)) := by\n rw [LinearPMap.IsClosed, LinearMap.graph_domainOperator, \u2190 coe_prod, LinearMap.coe_range,\n coe_coe]\n\nend Closed\n\nsection Resolvent\n\nvariable {R D H : Type*} [CommRing R] [AddCommGroup D] [Module R D] [TopologicalSpace D]\n [AddCommGroup H] [Module R H] [TopologicalSpace H] [IsTopologicalAddGroup H]\n [ContinuousConstSMul R H] {\u03b9 A : D \u2192L[R] H} {h\u03b9 : Injective \u03b9} {c : R}\n\n/-- On the domain of `LinearMap.domainOperator \u03b9 A h\u03b9`, the shift\n`c \u2022 I - LinearMap.domainOperator \u03b9 A h\u03b9` is the shift `c \u2022 \u03b9 - A` of the pair. -/\ntheorem smul_sub_domainOperator_apply\n {y : (\u03b9.toLinearMap.domainOperator A.toLinearMap h\u03b9).domain} {x : D} (hx : \u03b9 x = y) :\n c \u2022 (y : H) - \u03b9.toLinearMap.domainOperator A.toLinearMap h\u03b9 y = (c \u2022 \u03b9 - A) x := by\n rw [LinearMap.domainOperator_apply _ _ h\u03b9 hx, \u2190 hx, coe_coe, _root_.sub_apply,\n _root_.smul_apply]\n\n", "statement": "/-- If `c \u2022 \u03b9 - A` is invertible, then `\u03b9 \u2218 (c \u2022 \u03b9 - A)\u207b\u00b9` inverts the shift\n`c \u2022 I - LinearMap.domainOperator \u03b9 A h\u03b9`. -/\ntheorem isResolventAt_domainOperator (h : (c \u2022 \u03b9 - A).IsInvertible) :\n (\u03b9.toLinearMap.domainOperator A.toLinearMap h\u03b9).IsResolventAt c\n (\u03b9 \u2218L (c \u2022 \u03b9 - A).inverse) ", "proof": " by\n refine LinearPMap.isResolventAt_iff_forall_mem_graph.2 \u27e8fun y \u21a6 ?_, fun p hp \u21a6 ?_\u27e9\n \u00b7 have hx : c \u2022 \u03b9 ((c \u2022 \u03b9 - A).inverse y) - A ((c \u2022 \u03b9 - A).inverse y) = y := by\n simpa using h.self_apply_inverse y\n refine (LinearMap.mem_graph_domainOperator_iff _ _ h\u03b9).2\n \u27e8(c \u2022 \u03b9 - A).inverse y, by simp, ?_\u27e9\n simp only [coe_coe, comp_apply]\n generalize (c \u2022 \u03b9 - A).inverse y = x at hx \u22a2\n rw [\u2190 hx, sub_sub_cancel]\n \u00b7 obtain \u27e8x, hx, hAx\u27e9 := (LinearMap.mem_graph_domainOperator_iff _ _ h\u03b9).1 hp\n rw [coe_coe] at hx hAx\n have hshift : c \u2022 \u03b9 x - A x = (c \u2022 \u03b9 - A) x := by simp\n rw [\u2190 hx, \u2190 hAx, hshift, comp_apply, h.inverse_apply_self]", "proof_lines": 12, "proof_length": 612, "rev": "75c8aed5fea63047615a25a9763fd5b68a86e891", "heartbeats": 1729, "image": "lean-compression:tauceti-75c8aed5fe-a608030cfc", "split": "dev"} {"path": "TauCeti/Algebra/AlgebraicGroup/Tangent/Gauge/Basic.lean", "module": "TauCeti.Algebra.AlgebraicGroup.Tangent.Gauge.Basic", "theorem": "Derivation.pointRightLogDeriv_eq_zero_iff", "prefix": "/-\nCopyright (c) 2026 The Tau Ceti contributors. All rights reserved.\nReleased under Apache 2.0 license as described in the file LICENSE.\nAuthors: The Tau Ceti contributors\n-/\nmodule\n\npublic import TauCeti.Algebra.AlgebraicGroup.Tangent.CounitPoints\npublic import TauCeti.Algebra.AlgebraicGroup.Tangent.Naturality\npublic import TauCeti.RingTheory.Derivation.Convolution\n\n/-!\n# Logarithmic derivatives of points and the gauge action\n\nLet `H` be a commutative Hopf algebra over `R`, the coordinate ring of an affine group `G`, and\nlet `D` be an `R`-derivation of a commutative `R`-algebra `B`. A point `g \u2208 G(B)`, an algebra map\n`H \u2192 B`, can be differentiated along `D`: the composite `D \u2218 g` is a derivation of `H` at the\npoint `g`. Translating it back to the identity by the convolution inverse gives the **right\nlogarithmic derivative**\n\n`dlog g = (D \u2218 g) \u22c6 g\u207b\u00b9`,\n\na derivation of `H` at the counit, that is, a tangent vector in `Lie(G) (B)`\n(`Derivation.pointRightLogDeriv`). For `G = GL\u2099` this is the matrix `(Dg) g\u207b\u00b9`\n(`TauCeti.GeneralLinear.tangentMatrix_pointRightLogDeriv`), and for `G = \ud835\udd3e\u2098` it is `Du / u`\n(`TauCeti.MultiplicativeGroup.tangentLinearEquiv_pointRightLogDeriv`).\n\nThe logarithmic derivative is a crossed homomorphism for the adjoint action,\n`dlog (g h) = dlog g + Ad g (dlog h)`, and it vanishes exactly on the horizontal points, those\nwith `D \u2218 g = 0`. Twisting the adjoint action by it gives the **gauge action**\n\n`gauge g A = Ad g A - dlog g`\n\nof `G(B)` on tangent vectors `A`, which read as the connections `D + A` on the trivial\n`G`-torsor over `B` (`Derivation.pointGauge`). It is a left action,\n`gauge (g h) A = gauge g (gauge h A)`, and `g` carries `A` to `A'` exactly when `g` solves the\nlinear differential equation `D \u2218 g = g \u22c6 A - A' \u22c6 g`. Both constructions are natural in `B`\nalong algebra maps intertwining the derivations.\n\nFor `B = R\u2e28t\u2e29` and `D = d/dt`, this is the gauge action of the formal loop group `G(R\u2e28t\u2e29)` on\nconnections `d + A dt` on the punctured formal disc, over every coefficient algebra `R`,\nnonreduced ones included.\n\n## Main definitions\n\n* `Derivation.pointRightLogDeriv D g`: the right logarithmic derivative `(D \u2218 g) \u22c6 g\u207b\u00b9`.\n* `Derivation.pointGauge D g A`: the gauge action `Ad g A - dlog g`.\n* `Derivation.pointGaugeMulAction D`: the gauge action as a `MulAction`, installed locally.\n* `Derivation.pointGaugeStabilizer D A`: the stabilizer of the connection `D + A`.\n\n## Main results\n\n* `Derivation.pointRightLogDeriv_mul`: the crossed-homomorphism law.\n* `Derivation.pointRightLogDeriv_eq_zero_iff`: `dlog g = 0` exactly when `D \u2218 g = 0`.\n* `Derivation.mapValue_pointRightLogDeriv`, `Derivation.mapValue_pointGauge`: naturality in\n the coefficient algebra.\n* `Derivation.pointGauge_one`, `Derivation.pointGauge_mul`: the gauge action is a left action.\n* `Derivation.pointGauge_eq_iff`: gauge transformations are the solutions of a linear\n differential equation.\n* `Derivation.pointGauge_of_isCocomm`: for a commutative group the gauge action is translation\n by `-dlog g`.\n\n## References\n\n* E. Frenkel, *Langlands correspondence for loop groups*, Cambridge Stud. Adv. Math. 103 (2007),\n \u00a71.2.4, (1.2-4), and \u00a71.2.6, (1.2-7).\n* E. Frenkel and D. Gaitsgory, *Local geometric Langlands correspondence and affine Kac\u2013Moody\n algebras*, \u00a71.1, (1.2).\n-/\n\npublic section\n\nopen TauCeti WithConv\n\nnamespace Derivation\n\nsection CommSemiring\n\nvariable {R H B : Type*} [CommSemiring R] [CommSemiring H] [HopfAlgebra R H]\n [CommSemiring B] [Algebra R B] (D : Derivation R B B)\n\n/-- The convolution `(D \u2218 g) \u22c6 g\u207b\u00b9` satisfies the Leibniz rule at the counit:\ncomposed with the multiplication of `H` it is `1 \u22a0 \u03b4 + \u03b4 \u22a0 1`. -/\nprivate lemma toConv_dlog_comp_mul' (g : WithConv (H \u2192\u2090[R] B)) :\n toConv ((toConv ((D : B \u2192\u2097[R] B) \u2218\u2097 g.ofConv.toLinearMap) *\n toConv (g\u207b\u00b9).ofConv.toLinearMap).ofConv \u2218\u2097 LinearMap.mul' R H) =\n mulTensor 1 (toConv ((D : B \u2192\u2097[R] B) \u2218\u2097 g.ofConv.toLinearMap) *\n toConv (g\u207b\u00b9).ofConv.toLinearMap) +\n mulTensor (toConv ((D : B \u2192\u2097[R] B) \u2218\u2097 g.ofConv.toLinearMap) *\n toConv (g\u207b\u00b9).ofConv.toLinearMap) 1 := by\n have h := LinearMap.convMul_comp_coalgHom_distrib\n (toConv ((D : B \u2192\u2097[R] B) \u2218\u2097 g.ofConv.toLinearMap)) (toConv ((g\u207b\u00b9).ofConv.toLinearMap))\n (_root_.Bialgebra.mulCoalgHom R H)\n have hmul : (_root_.Bialgebra.mulCoalgHom R H).toLinearMap = LinearMap.mul' R H :=\n _root_.Bialgebra.toLinearMap_mulCoalgHom\n rw [hmul] at h\n rw [h, toConv_ofConv, ofConv_toConv, LinearMap.comp_assoc,\n D.toConv_comp_toLinearMap_comp_mul' g.ofConv,\n ofConv_toConv, AlgHom.toConv_toLinearMap_comp_mul' (g\u207b\u00b9).ofConv, add_mul,\n WithConv.mulTensor_convMul, WithConv.mulTensor_convMul, algHom_toConv_mul_toConv_inv]\n\n/-- **The right logarithmic derivative of a point** `g \u2208 G(B)` along a derivation `D` of `B`:\nthe tangent vector `dlog g = (D \u2218 g) \u22c6 g\u207b\u00b9` at the identity, obtained by translating the\nderivative `D \u2218 g` of `g` back to the identity by the convolution inverse of `g`. -/\nnoncomputable def pointRightLogDeriv (g : WithConv (H \u2192\u2090[R] B)) :\n Derivation R H (Bialgebra.CounitAlgebra R H B) where\n toLinearMap := (Bialgebra.CounitAlgebra.algEquivSelf R H B).symm.toLinearMap \u2218\u2097\n (toConv ((D : B \u2192\u2097[R] B) \u2218\u2097 g.ofConv.toLinearMap) *\n toConv (g\u207b\u00b9).ofConv.toLinearMap).ofConv\n map_one_eq_zero' := by\n -- Both factors evaluate at `1` factorwise since `comul 1 = 1 \u2297 1`, and `D 1 = 0`.\n rw [LinearMap.comp_apply, AlgEquiv.toLinearMap_apply, EmbeddingLike.map_eq_zero_iff]\n simp [LinearMap.convMul_apply, Algebra.TensorProduct.one_def]\n leibniz' a b := by\n have h := congrArg (fun F => F.ofConv (a \u2297\u209c[R] b)) (toConv_dlog_comp_mul' D g)\n simp only [LinearMap.coe_comp, Function.comp_apply, LinearMap.mul'_apply,\n ofConv_add, LinearMap.add_apply, WithConv.mulTensor_apply_tmul,\n LinearMap.convOne_apply] at h\n apply (Bialgebra.CounitAlgebra.algEquivSelf R H B).injective\n simp only [LinearMap.coe_comp, Function.comp_apply, AlgEquiv.toLinearMap_apply, map_add,\n Bialgebra.CounitAlgebra.algEquivSelf_smul, AlgEquiv.apply_symm_apply, h]\n ring\n\n/-- The right logarithmic derivative is the convolution `(D \u2218 g) \u22c6 g\u207b\u00b9`, transported into the\ncounit algebra. -/\ntheorem pointRightLogDeriv_apply (g : WithConv (H \u2192\u2090[R] B)) (a : H) :\n D.pointRightLogDeriv g a = (Bialgebra.CounitAlgebra.algEquivSelf R H B).symm\n ((toConv ((D : B \u2192\u2097[R] B) \u2218\u2097 g.ofConv.toLinearMap) *\n toConv (g\u207b\u00b9).ofConv.toLinearMap).ofConv a) :=\n (rfl)\n\n/-- The right logarithmic derivative, valuewise in the coefficient algebra. -/\ntheorem algEquivSelf_pointRightLogDeriv_apply (g : WithConv (H \u2192\u2090[R] B)) (a : H) :\n Bialgebra.CounitAlgebra.algEquivSelf R H B (D.pointRightLogDeriv g a) =\n (toConv ((D : B \u2192\u2097[R] B) \u2218\u2097 g.ofConv.toLinearMap) *\n toConv (g\u207b\u00b9).ofConv.toLinearMap).ofConv a := by\n rw [pointRightLogDeriv_apply, AlgEquiv.apply_symm_apply]\n\n/-- The right logarithmic derivative, read in the coefficient algebra, is the convolution\n`(D \u2218 g) \u22c6 g\u207b\u00b9`. -/\ntheorem toConv_algEquivSelf_comp_pointRightLogDeriv (g : WithConv (H \u2192\u2090[R] B)) :\n toConv ((Bialgebra.CounitAlgebra.algEquivSelf R H B).toLinearMap \u2218\u2097\n \u2191(D.pointRightLogDeriv g)) =\n toConv ((D : B \u2192\u2097[R] B) \u2218\u2097 g.ofConv.toLinearMap) * toConv (g\u207b\u00b9).ofConv.toLinearMap := by\n refine ofConv_injective (LinearMap.ext fun a => ?_)\n simp only [LinearMap.comp_apply, AlgEquiv.toLinearMap_apply, Derivation.coeFn_coe,\n algEquivSelf_pointRightLogDeriv_apply]\n\n/-- Two tangent vectors agree exactly when they agree after identifying the counit algebra with\nthe coefficient algebra. -/\nprivate lemma toConv_algEquivSelf_comp_inj\n {d d' : Derivation R H (Bialgebra.CounitAlgebra R H B)} :\n toConv ((Bialgebra.CounitAlgebra.algEquivSelf R H B).toLinearMap \u2218\u2097\n (d : H \u2192\u2097[R] Bialgebra.CounitAlgebra R H B)) =\n toConv ((Bialgebra.CounitAlgebra.algEquivSelf R H B).toLinearMap \u2218\u2097\n (d' : H \u2192\u2097[R] Bialgebra.CounitAlgebra R H B)) \u2194 d = d' :=\n \u27e8fun h => Derivation.ext fun a => (Bialgebra.CounitAlgebra.algEquivSelf R H B).injective\n (LinearMap.congr_fun (congrArg ofConv h) a), fun h => h \u25b8 rfl\u27e9\n\n/-- The adjoint action of a point `g \u2208 G(B)`, read in the coefficient algebra, is the\nconvolution conjugation `g \u22c6 d \u22c6 g\u207b\u00b9`. -/\ntheorem toConv_algEquivSelf_comp_adDerivation (g : WithConv (H \u2192\u2090[R] B))\n (d : Derivation R H (Bialgebra.CounitAlgebra R H B)) :\n toConv ((Bialgebra.CounitAlgebra.algEquivSelf R H B).toLinearMap \u2218\u2097\n \u2191(adDerivation B ((Bialgebra.CounitAlgebra.pointsMulEquiv R H B).symm g) d)) =\n toConv g.ofConv.toLinearMap *\n toConv ((Bialgebra.CounitAlgebra.algEquivSelf R H B).toLinearMap \u2218\u2097 \u2191d) *\n toConv (g\u207b\u00b9).ofConv.toLinearMap := by\n -- The distributivity lemma is stated for the linear map of an `AlgHom`, so first\n -- rewrite the linear map of the `AlgEquiv` as that of its underlying `AlgHom`.\n rw [coe_adDerivation_linearMap, \u2190 map_inv, \u2190 AlgEquiv.toLinearEquiv_toLinearMap,\n \u2190 AlgEquiv.toAlgHom_toLinearMap, LinearMap.algHom_comp_convMul_distrib, ofConv_toConv,\n LinearMap.algHom_comp_convMul_distrib, ofConv_toConv, toConv_ofConv]\n simp only [AlgEquiv.toAlgHom_toLinearMap, WithConv.algEquivSelf_comp_pointsMulEquiv_symm]\n\n/-- The identity point has zero logarithmic derivative. -/\n@[simp]\ntheorem pointRightLogDeriv_one : D.pointRightLogDeriv (1 : WithConv (H \u2192\u2090[R] B)) = 0 := by\n have h : toConv ((D : B \u2192\u2097[R] B) \u2218\u2097 (1 : WithConv (H \u2192\u2090[R] B)).ofConv.toLinearMap) = 0 := by\n refine ofConv_injective (LinearMap.ext fun a => ?_)\n simp [AlgHom.convOne_apply]\n apply toConv_algEquivSelf_comp_inj.mp\n rw [toConv_algEquivSelf_comp_pointRightLogDeriv, h, zero_mul]\n simp\n\n/-- **The logarithmic derivative is a crossed homomorphism** for the adjoint action:\n`dlog (g h) = dlog g + Ad g (dlog h)`. -/\ntheorem pointRightLogDeriv_mul (g h : WithConv (H \u2192\u2090[R] B)) :\n D.pointRightLogDeriv (g * h) =\n D.pointRightLogDeriv g +\n adDerivation B ((Bialgebra.CounitAlgebra.pointsMulEquiv R H B).symm g)\n (D.pointRightLogDeriv h) := by\n apply toConv_algEquivSelf_comp_inj.mp\n have hgh : (g * h).ofConv.toLinearMap =\n (toConv g.ofConv.toLinearMap * toConv h.ofConv.toLinearMap).ofConv := by\n rw [\u2190 AlgHom.toLinearMap_convMul, ofConv_toConv]\n rw [Derivation.coe_add_linearMap, LinearMap.comp_add, toConv_add,\n toConv_algEquivSelf_comp_adDerivation, toConv_algEquivSelf_comp_pointRightLogDeriv,\n toConv_algEquivSelf_comp_pointRightLogDeriv, toConv_algEquivSelf_comp_pointRightLogDeriv,\n hgh, Derivation.toConv_comp_convMul, toConv_ofConv, toConv_ofConv, mul_inv_rev,\n AlgHom.toLinearMap_convMul]\n set tg := toConv g.ofConv.toLinearMap\n set th := toConv h.ofConv.toLinearMap\n calc (toConv ((D : B \u2192\u2097[R] B) \u2218\u2097 g.ofConv.toLinearMap) * th +\n tg * toConv ((D : B \u2192\u2097[R] B) \u2218\u2097 h.ofConv.toLinearMap)) *\n (toConv (h\u207b\u00b9).ofConv.toLinearMap * toConv (g\u207b\u00b9).ofConv.toLinearMap)\n = toConv ((D : B \u2192\u2097[R] B) \u2218\u2097 g.ofConv.toLinearMap) *\n (th * toConv (h\u207b\u00b9).ofConv.toLinearMap) * toConv (g\u207b\u00b9).ofConv.toLinearMap +\n tg * (toConv ((D : B \u2192\u2097[R] B) \u2218\u2097 h.ofConv.toLinearMap) *\n toConv (h\u207b\u00b9).ofConv.toLinearMap) * toConv (g\u207b\u00b9).ofConv.toLinearMap := by\n simp only [add_mul, mul_assoc]\n _ = _ := by rw [algHom_toConv_mul_toConv_inv, mul_one]\n\n", "statement": "/-- **Horizontal points**: the logarithmic derivative of `g` vanishes exactly when `g` is\nkilled by `D`, that is, when every coordinate of `g` is a constant for `D`. -/\ntheorem pointRightLogDeriv_eq_zero_iff (g : WithConv (H \u2192\u2090[R] B)) :\n D.pointRightLogDeriv g = 0 \u2194 (D : B \u2192\u2097[R] B) \u2218\u2097 g.ofConv.toLinearMap = 0 ", "proof": " by\n constructor\n \u00b7 intro h0\n have h := toConv_algEquivSelf_comp_pointRightLogDeriv D g\n rw [h0, Derivation.coe_zero_linearMap, LinearMap.comp_zero, toConv_zero] at h\n apply toConv_injective\n calc toConv ((D : B \u2192\u2097[R] B) \u2218\u2097 g.ofConv.toLinearMap)\n = toConv ((D : B \u2192\u2097[R] B) \u2218\u2097 g.ofConv.toLinearMap) * toConv (g\u207b\u00b9).ofConv.toLinearMap *\n toConv g.ofConv.toLinearMap := by\n rw [mul_assoc, algHom_toConv_inv_mul_toConv, mul_one]\n _ = 0 := by rw [\u2190 h, zero_mul]\n \u00b7 intro h0\n apply toConv_algEquivSelf_comp_inj.mp\n rw [toConv_algEquivSelf_comp_pointRightLogDeriv, h0, toConv_zero, zero_mul,\n Derivation.coe_zero_linearMap, LinearMap.comp_zero, toConv_zero]", "proof_lines": 14, "proof_length": 634, "rev": "75c8aed5fea63047615a25a9763fd5b68a86e891", "heartbeats": 854, "image": "lean-compression:tauceti-75c8aed5fe-a608030cfc", "split": "dev"} {"path": "TauCeti/MeasureTheory/Function/SeparatedVariables.lean", "module": "TauCeti.MeasureTheory.Function.SeparatedVariables", "theorem": "EuclideanSpace.setLIntegral_ball_comp_snd_consEquivL_symm_le", "prefix": "/-\nCopyright (c) 2026 The Tau Ceti contributors. All rights reserved.\nReleased under Apache 2.0 license as described in the file LICENSE.\nAuthors: The Tau Ceti contributors\n-/\nmodule\n\npublic import Mathlib.MeasureTheory.Integral.Average\npublic import TauCeti.MeasureTheory.Measure.Haar.EuclideanSpace\nimport TauCeti.MeasureTheory.Function.Lp.Iterated\n\n/-!\n# Functions of separated variables on `\u211d\u207f\u207a\u00b9 = \u211d \u00d7 \u211d\u207f`\n\nSplitting off the first coordinate, `EuclideanSpace.consEquivL \u211d n`, identifies `\u211d\u207f\u207a\u00b9` with\n`\u211d \u00d7 \u211d\u207f` and its volume with the product of the volumes of `\u211d` and `\u211d\u207f`\n(`EuclideanSpace.measurePreserving_consEquivL`). Write `y = (t, x)` accordingly. This file records\nhow this identification acts on functions of one of the two variables and on products\n`g(x) \u2022 h(t)` of such functions:\n\n* `EuclideanSpace.eLpNorm_smul_comp_consEquivL_symm`: the `L\u1d56` seminorm of `y \u21a6 g(x) \u2022 h(t)` is\n the product of the `L\u1d56` seminorms of `h` on `\u211d` and of `g` on `\u211d\u207f`, for every `p` and every\n scalar action compatible with the extended norms; with its `lpNorm` and `MemLp` forms\n `EuclideanSpace.lpNorm_smul_comp_consEquivL_symm` and\n `MeasureTheory.MemLp.smul_comp_consEquivL_symm`, and the support statement\n `HasCompactSupport.smul_comp_consEquivL_symm`.\n* `EuclideanSpace.setLIntegral_ball_comp_snd_consEquivL_symm_le` and\n `EuclideanSpace.setLAverage_ball_comp_snd_consEquivL_symm_le`: for a function `G` of `x` alone,\n the integral of `G` over a ball `B(c, s)` of `\u211d\u207f\u207a\u00b9` is at most `2 s` times its integral over the\n ball `B(x_c, s)` of `\u211d\u207f`, and its average over `B(c, s)` at most `2\u207f\u207a\u00b9` times its average over\n `B(x_c, s)`. So functions of fewer variables inherit integrability on balls\n (`MeasureTheory.LocallyIntegrable.integrableOn_ball_comp_snd_consEquivL_symm`) and bounds on mean\n oscillations.\n-/\n\npublic section\n\nopen MeasureTheory Metric Set\nopen scoped ENNReal\n\nnamespace MeasureTheory\n\nvariable {n : \u2115} {F : Type*} [NormedAddCommGroup F]\n\n/-- A function of the last `n` coordinates of `\u211d\u207f\u207a\u00b9` is a.e. strongly measurable when it is on\n`\u211d\u207f`. -/\ntheorem AEStronglyMeasurable.comp_snd_consEquivL_symm {f : EuclideanSpace \u211d (Fin n) \u2192 F}\n (hf : AEStronglyMeasurable f volume) :\n AEStronglyMeasurable (fun y => f ((EuclideanSpace.consEquivL \u211d n).symm y).2) volume := by\n have hmp : MeasurePreserving (EuclideanSpace.consEquivL \u211d n).toHomeomorph.toMeasurableEquiv\n volume volume :=\n EuclideanSpace.measurePreserving_consEquivL n\n have h : AEStronglyMeasurable (fun z : \u211d \u00d7 EuclideanSpace \u211d (Fin n) => f z.2) volume := by\n rw [Measure.volume_eq_prod]\n exact hf.comp_snd\n exact h.comp_measurePreserving hmp.symm\n\nend MeasureTheory\n\n/-- The product `y \u21a6 g(x) \u2022 h(t)` of two functions with compact support has compact support. -/\ntheorem HasCompactSupport.smul_comp_consEquivL_symm {n : \u2115} {\ud835\udd5c E : Type*} [Zero \ud835\udd5c] [Zero E]\n [SMulWithZero \ud835\udd5c E] {g : EuclideanSpace \u211d (Fin n) \u2192 \ud835\udd5c} {h : \u211d \u2192 E} (hg : HasCompactSupport g)\n (hh : HasCompactSupport h) :\n HasCompactSupport fun y => g ((EuclideanSpace.consEquivL \u211d n).symm y).2 \u2022\n h ((EuclideanSpace.consEquivL \u211d n).symm y).1 := by\n refine HasCompactSupport.intro\n ((hh.prod hg).image (EuclideanSpace.consEquivL \u211d n).continuous) fun y hy => ?_\n have hy' : (EuclideanSpace.consEquivL \u211d n).symm y \u2209 tsupport h \u00d7\u02e2 tsupport g := fun hmem =>\n hy \u27e8_, hmem, (EuclideanSpace.consEquivL \u211d n).apply_symm_apply y\u27e9\n rcases not_and_or.1 (mem_prod.not.1 hy') with h1 | h2\n \u00b7 rw [image_eq_zero_of_notMem_tsupport h1, smul_zero]\n \u00b7 rw [image_eq_zero_of_notMem_tsupport h2, zero_smul]\n\nnamespace EuclideanSpace\n\nvariable {n : \u2115} {p : \u211d\u22650\u221e}\n\n/-- **The `L\u1d56` seminorm of a function of separated variables.** On `\u211d\u207f\u207a\u00b9 = \u211d \u00d7 \u211d\u207f`, the `L\u1d56`\nseminorm of `y \u21a6 g(x) \u2022 h(t)` is the product of those of `h` and `g`, for every exponent. -/\ntheorem eLpNorm_smul_comp_consEquivL_symm {\ud835\udd5c \u03b5 : Type*} [TopologicalSpace \ud835\udd5c]\n [ContinuousENorm \ud835\udd5c] [TopologicalSpace \u03b5] [ContinuousENorm \u03b5] [SMul \ud835\udd5c \u03b5] [ContinuousSMul \ud835\udd5c \u03b5]\n [ENormSMulClass \ud835\udd5c \u03b5] {g : EuclideanSpace \u211d (Fin n) \u2192 \ud835\udd5c} {h : \u211d \u2192 \u03b5}\n (hg : AEStronglyMeasurable g volume) (hh : AEStronglyMeasurable h volume) :\n eLpNorm (fun y => g ((consEquivL \u211d n).symm y).2 \u2022 h ((consEquivL \u211d n).symm y).1) p volume =\n eLpNorm h p volume * eLpNorm g p volume := by\n -- `y \u21a6 (x, t)` carries the volume of `\u211d\u207f\u207a\u00b9` to the product volume on `\u211d\u207f \u00d7 \u211d`.\n have hmp : MeasurePreserving (fun y => ((consEquivL \u211d n).symm y).swap) volume\n ((volume : Measure (EuclideanSpace \u211d (Fin n))).prod (volume : Measure \u211d)) := by\n have he : MeasurePreserving (consEquivL \u211d n).toHomeomorph.toMeasurableEquiv volume volume :=\n measurePreserving_consEquivL n\n have he' := he.symm\n rw [Measure.volume_eq_prod] at he'\n exact Measure.measurePreserving_swap.comp he'\n have hgh : AEStronglyMeasurable (fun z : EuclideanSpace \u211d (Fin n) \u00d7 \u211d => g z.1 \u2022 h z.2)\n (volume.prod volume) :=\n hg.comp_fst.smul hh.comp_snd\n rw [mul_comm, \u2190 TauCeti.eLpNorm_prod_smul hg hh, \u2190 eLpNorm_comp_measurePreserving hgh hmp]\n -- The two integrands agree pointwise: `((t, x).swap).1 = x` and `((t, x).swap).2 = t`.\n rfl\n\n/-- The `lpNorm` form of `EuclideanSpace.eLpNorm_smul_comp_consEquivL_symm`. -/\ntheorem lpNorm_smul_comp_consEquivL_symm {\ud835\udd5c E : Type*} [NormedAddCommGroup \ud835\udd5c]\n [NormedAddCommGroup E] [SMul \ud835\udd5c E] [ContinuousSMul \ud835\udd5c E] [ENormSMulClass \ud835\udd5c E]\n {g : EuclideanSpace \u211d (Fin n) \u2192 \ud835\udd5c} {h : \u211d \u2192 E}\n (hg : AEStronglyMeasurable g volume) (hh : AEStronglyMeasurable h volume) :\n lpNorm (fun y => g ((consEquivL \u211d n).symm y).2 \u2022 h ((consEquivL \u211d n).symm y).1) p volume =\n lpNorm h p volume * lpNorm g p volume := by\n rw [lpNorm, eLpNorm_smul_comp_consEquivL_symm hg hh, ENNReal.toReal_mul, lpNorm, lpNorm]\n\nend EuclideanSpace\n\n/-- The product `y \u21a6 g(x) \u2022 h(t)` of an `L\u1d56` function on `\u211d\u207f` and an `L\u1d56` function on `\u211d` is an\n`L\u1d56` function on `\u211d\u207f\u207a\u00b9`. -/\ntheorem MeasureTheory.MemLp.smul_comp_consEquivL_symm {n : \u2115} {p : \u211d\u22650\u221e} {\ud835\udd5c \u03b5 : Type*}\n [TopologicalSpace \ud835\udd5c] [ContinuousENorm \ud835\udd5c] [TopologicalSpace \u03b5] [ContinuousENorm \u03b5] [SMul \ud835\udd5c \u03b5]\n [ContinuousSMul \ud835\udd5c \u03b5] [ENormSMulClass \ud835\udd5c \u03b5] {g : EuclideanSpace \u211d (Fin n) \u2192 \ud835\udd5c} {h : \u211d \u2192 \u03b5}\n (hg : MemLp g p volume) (hh : MemLp h p volume) :\n MemLp (fun y => g ((EuclideanSpace.consEquivL \u211d n).symm y).2 \u2022\n h ((EuclideanSpace.consEquivL \u211d n).symm y).1) p volume := by\n rw [memLp_iff, EuclideanSpace.eLpNorm_smul_comp_consEquivL_symm hg.aestronglyMeasurable\n hh.aestronglyMeasurable]\n exact ENNReal.mul_lt_top hh.eLpNorm_lt_top hg.eLpNorm_lt_top\n\nnamespace EuclideanSpace\n\nvariable {n : \u2115}\n\n", "statement": "/-- The integral over a ball `B(c, s)` of `\u211d\u207f\u207a\u00b9` of a function of the last `n` coordinates is at\nmost `2 s` times its integral over the ball `B(x_c, s)` of `\u211d\u207f`, `x_c` the last `n` coordinates of\n`c`. -/\ntheorem setLIntegral_ball_comp_snd_consEquivL_symm_le {G : EuclideanSpace \u211d (Fin n) \u2192 \u211d\u22650\u221e}\n (hG : AEMeasurable G) (c : EuclideanSpace \u211d (Fin (n + 1))) (s : \u211d) :\n \u222b\u207b y in ball c s, G ((consEquivL \u211d n).symm y).2 \u2264\n ENNReal.ofReal (2 * s) * \u222b\u207b x in ball ((consEquivL \u211d n).symm c).2 s, G x ", "proof": " by\n set e := consEquivL \u211d n\n set w := e.symm c\n have hmp := measurePreserving_consEquivL n\n have hemb : MeasurableEmbedding e := e.toHomeomorph.measurableEmbedding\n have hc : c = e w := (e.apply_symm_apply c).symm\n calc \u222b\u207b y in ball c s, G (e.symm y).2\n = \u222b\u207b z in e \u207b\u00b9' ball c s, G (e.symm (e z)).2 :=\n (hmp.setLIntegral_comp_preimage_emb hemb (fun y => G (e.symm y).2) _).symm\n _ = \u222b\u207b z in e \u207b\u00b9' ball c s, G z.2 := by simp only [ContinuousLinearEquiv.symm_apply_apply]\n _ \u2264 \u222b\u207b z in ball w.1 s \u00d7\u02e2 ball w.2 s, G z.2 :=\n lintegral_mono_set (hc \u25b8 preimage_consEquivL_ball_subset w s)\n _ = ENNReal.ofReal (2 * s) * \u222b\u207b x in ball w.2 s, G x := by\n rw [Measure.volume_eq_prod, \u2190 Measure.prod_restrict]\n have := lintegral_prod_mul (\u03bc := volume.restrict (ball w.1 s))\n (\u03bd := volume.restrict (ball w.2 s)) (f := fun _ => (1 : \u211d\u22650\u221e)) aemeasurable_const\n hG.restrict\n simpa only [one_mul, lintegral_const, Measure.restrict_apply_univ, Real.volume_ball]\n using this", "proof_lines": 18, "proof_length": 934, "rev": "75c8aed5fea63047615a25a9763fd5b68a86e891", "heartbeats": 4872, "image": "lean-compression:tauceti-75c8aed5fe-a608030cfc", "split": "dev"} {"path": "TauCeti/Algebra/Category/FGModuleCat/Generator/Cogenerator.lean", "module": "TauCeti.Algebra.Category.FGModuleCat.Generator.Cogenerator", "theorem": "FGModuleCat.not_isCoseparator_int", "prefix": "/-\nCopyright (c) 2026 The Tau Ceti contributors. All rights reserved.\nReleased under Apache 2.0 license as described in the file LICENSE.\nAuthors: The Tau Ceti contributors\n-/\nmodule\n\npublic import TauCeti.Algebra.Category.FGModuleCat.Generator.Basic\npublic import TauCeti.Algebra.Category.FGModuleCat.KrullSchmidt\npublic import TauCeti.Algebra.Category.FGModuleCat.MatlisDuality.Basic\npublic import TauCeti.Algebra.Category.FGModuleCat.Projective\npublic import TauCeti.CategoryTheory.Preadditive.KrullSchmidt.AdditiveClosure\n\nimport TauCeti.Algebra.Subalgebra.Center\nimport TauCeti.RingTheory.Artinian.Subalgebra\n\n/-!\n# Generator-cogenerators of `mod A` for an Artin algebra\n\nLet `R` be a commutative Artinian ring and `A` an Artin `R`-algebra. A finitely generated module\n`M` is a **generator-cogenerator** of `mod A = FGModuleCat A` (`TauCeti.IsGeneratorCogenerator`: a\nseparator and a coseparator) exactly when both the regular module `A` and its dual `D A` lie in the\nadditive closure `add M`, and exactly when every indecomposable projective and every\nindecomposable injective object of `mod A` is a direct summand of `M`\n(`TauCeti.isGeneratorCogenerator_iff_forall_indecomposable`). The base ring `R` may live in any\nuniverse; the statements about `D A` ask that it be small in the universe of `A` and its modules,\nwhich can always be arranged by replacing `R` with the centre of `A`, a commutative Artinian ring\nover which `A` is again an Artin algebra. The descriptions through indecomposable objects hold for\nmodules in any universe in which `A` is small.\n\nThe generator half holds over any ring (`FGModuleCat.isSeparator_iff_additiveClosure`). For the\ncogenerator half, the Matlis duality `(mod A)\u1d52\u1d56 \u224c mod A\u1d50\u1d52\u1d56`\n(`TauCeti.IsInjectiveEnvelope.fgModuleCatMatlisDuality`) turns the regular right module, a\nseparator of `mod A\u1d50\u1d52\u1d56`, into a coseparator `D A` of `mod A`\n(`TauCeti.IsInjectiveEnvelope.fgModuleCatMatlisDualRegular`, with its API in\n`TauCeti/Algebra/Category/FGModuleCat/MatlisDuality/Basic.lean`). Conversely `D A` is injective and\nfinitely generated, hence Artinian, and an Artinian injective object embeds into a finite sum of\ncopies of any coseparator `M`, as a direct summand\n(`CategoryTheory.IsCoseparator.additiveClosure_of_injective`). So `M` is a coseparator exactly when\n`D A \u2208 add M` (`TauCeti.IsInjectiveEnvelope.isCoseparator_iff_additiveClosure`). The descriptions\nthrough indecomposable objects then follow from the Krull-Schmidt property of `mod A`, with\n`FGModuleCat.indecomposable_obj_iff` and `FGModuleCat.additiveClosure_of_isGenerator_of_projective`:\na projective object lies in `add M` for every separator `M`, and dually an Artinian injective object\nlies in `add M` for every coseparator `M`.\n\nThe two halves are not symmetric outside the categorical statements. Over every ring the regular\nmodule is a finitely generated projective generator, so separators of `mod R` have the elementwise\ndescription `Module.IsGenerator` (`FGModuleCat.isSeparator_iff_isGenerator`). Coseparators of\n`mod R` also have an elementwise description, but only on finitely generated modules: linear maps\ninto `M` separate the points of every finitely generated module (`FGModuleCat.isCoseparator_iff`).\nThis is weaker than being a cogenerator of the category of all `R`-modules, which embeds every\nmodule into a possibly infinite product of copies of itself and need not be finitely generated,\nwhile `mod R` may have no coseparator at all (`mod \u2124` has none). A finitely generated cogenerator,\n`D A`, comes from the duality, which is why the cogenerator results here are stated for Artin\nalgebras.\n\nThe Artin hypothesis is needed for the indecomposable description. Over `\u2124`, the regular module is\nnot a coseparator of `mod \u2124`, since every morphism `\u2124/2\u2124 \u27f6 \u2124` is zero\n(`FGModuleCat.not_isCoseparator_int`). Yet `mod \u2124` has no nonzero injective object: a nonzero\nfinitely generated abelian group has a direct summand `\u2124` or `\u2124/p\u1d4f\u2124` with `k \u2265 1`, and the\nmonomorphisms `2 : \u2124 \u27f6 \u2124` and `\u2124/p\u1d4f\u2124 \u27f6 \u2124/p\u00b2\u1d4f\u2124` do not split. So every indecomposable projective\nand every indecomposable injective object of `mod \u2124` is a direct summand of `\u2124`, which is not a\ngenerator-cogenerator. (This last part is a remark and is not formalized here.)\n\n## Main results\n\n* `FGModuleCat.isSeparator_iff_forall_indecomposable`: over a left Artinian ring, `M` is a\n separator of `mod A` exactly when every indecomposable projective is a direct summand of `M`.\n* `TauCeti.IsInjectiveEnvelope.isCoseparator_iff_additiveClosure`: `M` is a coseparator of `mod A`\n exactly when `D A \u2208 add M`.\n* `TauCeti.IsInjectiveEnvelope.isGeneratorCogenerator_iff_additiveClosure`: `M` is a\n generator-cogenerator exactly when `A \u2208 add M` and `D A \u2208 add M`.\n* `FGModuleCat.exists_injective_isCoseparator`: `mod A` has an injective coseparator in any\n universe in which `A` is small.\n* `FGModuleCat.isCoseparator_iff_forall_indecomposable`: `M` is a coseparator exactly when every\n indecomposable injective is a direct summand of `M`.\n* `TauCeti.isGeneratorCogenerator_iff_forall_indecomposable`: `M` is a generator-cogenerator exactly\n when every indecomposable projective and every indecomposable injective is a direct summand of\n `M`.\n* `TauCeti.IsInjectiveEnvelope.isGeneratorCogenerator_regular_biprod_fgModuleCatMatlisDualRegular`:\n `A \u2295 D A` is a generator-cogenerator.\n* `FGModuleCat.not_isCoseparator_int`: `\u2124` is not a coseparator of `mod \u2124`.\n\n## References\n\n* M. Auslander, I. Reiten, S. O. Smal\u00f8, *Representation Theory of Artin Algebras*, Cambridge\n University Press (1995), Sections II.3 and VI.5.\n-/\n\npublic section\n\nnoncomputable section\n\nnamespace TauCeti\n\nopen CategoryTheory CategoryTheory.Limits Opposite\n\nuniverse u v w\n\nattribute [local instance] hasBinaryBiproducts_of_finite_biproducts\n\n/-- **The separators of `mod A` through indecomposables**: over a left Artinian ring, `M` is a\nseparator of `mod A` exactly when every indecomposable projective object is a direct summand of\n`M`. The modules may live in any universe in which `A` is small. -/\ntheorem _root_.FGModuleCat.isSeparator_iff_forall_indecomposable {A : Type u} [Ring A]\n [IsArtinianRing A] [Small.{w} A] (M : FGModuleCat.{w} A) :\n IsSeparator M \u2194\n \u2200 P : FGModuleCat.{w} A, Projective P \u2192 Indecomposable P.obj \u2192 Nonempty (Retract P M) := by\n -- The regular module, shrunk to the universe `w`, is a projective separator.\n have : Module.Free A (Shrink.{w} A) := .of_equiv (Shrink.linearEquiv A A).symm\n have : Projective (FGModuleCat.of A (Shrink.{w} A)) := FGModuleCat.projective_of_free A _\n refine \u27e8fun hM P hP hPi \u21a6 ?_, fun h \u21a6 ?_\u27e9\n \u00b7 have := FGModuleCat.isLocalRing_end_of_indecomposable hPi\n have := FGModuleCat.isGenerator_of_isSeparator hM\n exact additiveClosure_iff_nonempty_retract.1\n (FGModuleCat.additiveClosure_of_isGenerator_of_projective M P)\n \u00b7 refine (FGModuleCat.isSeparator_shrink A)\n |>.of_additiveClosure (additiveClosure_iff_forall_indecomposable.2 fun Y hY \u27e8r\u27e9 \u21a6 ?_)\n exact h Y r.projective ((FGModuleCat.indecomposable_obj_iff Y).2 hY)\n\nsection Artin\n\nvariable {R : Type u} [CommRing R] [IsArtinianRing R] {E : Type v} [AddCommGroup E] [Module R E]\n [Small.{v} R] {f : R \u29f8 Ring.jacobson R \u2192\u2097[R] E} {A : Type v} [Ring A] [Algebra R A]\n [Module.Finite R A]\n\n/-- **The coseparators of `mod A`**: `M` is a coseparator of `mod A` exactly when `D A` lies in\n`add M`. The forward direction holds as `D A` is a finitely generated, hence Artinian, injective\nobject (`CategoryTheory.IsCoseparator.additiveClosure_of_injective`), and the converse as `D A` is a\ncoseparator. -/\ntheorem IsInjectiveEnvelope.isCoseparator_iff_additiveClosure (hf : IsInjectiveEnvelope f)\n (M : FGModuleCat.{v} A) :\n IsCoseparator M \u2194 additiveClosure M (hf.fgModuleCatMatlisDualRegular (A := A)) :=\n have := IsArtinianRing.of_finite R A\n \u27e8fun hM \u21a6 hM.additiveClosure_of_injective _,\n hf.isCoseparator_fgModuleCatMatlisDualRegular.of_additiveClosure\u27e9\n\n/-- **The generator-cogenerators of `mod A`**: `M` is a generator-cogenerator exactly when the\nregular module `A` and its dual `D A` lie in `add M`. -/\ntheorem IsInjectiveEnvelope.isGeneratorCogenerator_iff_additiveClosure\n (hf : IsInjectiveEnvelope f) (M : FGModuleCat.{v} A) :\n IsGeneratorCogenerator M \u2194 additiveClosure M (FGModuleCat.of A A) \u2227\n additiveClosure M (hf.fgModuleCatMatlisDualRegular (A := A)) :=\n isGeneratorCogenerator_iff.trans <| and_congr (FGModuleCat.isSeparator_iff_additiveClosure M)\n (hf.isCoseparator_iff_additiveClosure M)\n\n/-- **`A \u2295 D A` is a generator-cogenerator** of `mod A`. -/\ntheorem IsInjectiveEnvelope.isGeneratorCogenerator_regular_biprod_fgModuleCatMatlisDualRegular\n (hf : IsInjectiveEnvelope f) :\n IsGeneratorCogenerator (FGModuleCat.of A A \u229e hf.fgModuleCatMatlisDualRegular (A := A)) :=\n (hf.isGeneratorCogenerator_iff_additiveClosure _).2\n \u27e8(additiveClosure _).prop_of_retract \u27e8biprod.inl, biprod.fst, by simp\u27e9 (additiveClosure_self _),\n (additiveClosure _).prop_of_retract \u27e8biprod.inr, biprod.snd, by simp\u27e9\n (additiveClosure_self _)\u27e9\n\nend Artin\n\n/-- The category of finitely generated modules over an Artin algebra has an injective\ncoseparator in any universe in which the algebra is small. -/\ntheorem _root_.FGModuleCat.exists_injective_isCoseparator (R : Type u) [CommRing R]\n [IsArtinianRing R] {A : Type v} [Ring A] [Algebra R A] [Module.Finite R A] [Small.{w} A] :\n \u2203 D : FGModuleCat.{w} A, Injective D \u2227 IsCoseparator D := by\n -- Use the centre to take an injective hull of its semisimple quotient in universe `w`.\n let C := Subalgebra.center R A\n have : Module.Finite C A := Subalgebra.finite_centerAlgebra_of_finite\n have : Small.{w} C := inferInstanceAs (Small.{w} {a : A // a \u2208 C})\n obtain \u27e8E, _, _, f, hf, -\u27e9 := exists_isInjectiveEnvelope_quotient_jacobson.{v, w} C\n -- Dualize the shrunk right regular module, a projective separator.\n let \u03a6 := hf.fgModuleCatMatlisDuality (A := A)\n have : Small.{w} A\u1d50\u1d52\u1d56 := small_of_injective MulOpposite.unop_injective\n let G := FGModuleCat.of A\u1d50\u1d52\u1d56 (Shrink.{w} A\u1d50\u1d52\u1d56)\n have : Module.Free A\u1d50\u1d52\u1d56 (Shrink.{w} A\u1d50\u1d52\u1d56) := .of_equiv (Shrink.linearEquiv A\u1d50\u1d52\u1d56 A\u1d50\u1d52\u1d56).symm\n have : Projective G := FGModuleCat.projective_of_free _ _\n have : Projective (\u03a6.inverse.obj G) := (\u03a6.symm.map_projective_iff _).2 inferInstance\n exact \u27e8(\u03a6.inverse.obj G).unop, inferInstanceAs (Injective (unop _)),\n (isCoseparator_unop_iff _).2 ((FGModuleCat.isSeparator_shrink A\u1d50\u1d52\u1d56).of_equivalence \u03a6.symm)\u27e9\n\n/-- **The coseparators of `mod A` through indecomposables**: over an Artin algebra, `M` is a\ncoseparator of `mod A` exactly when every indecomposable injective object is a direct summand of\n`M`. The modules may live in any universe in which `A` is small. -/\ntheorem _root_.FGModuleCat.isCoseparator_iff_forall_indecomposable (R : Type u) [CommRing R]\n [IsArtinianRing R] {A : Type v} [Ring A] [Algebra R A] [Module.Finite R A] [Small.{w} A]\n (M : FGModuleCat.{w} A) :\n IsCoseparator M \u2194\n \u2200 I : FGModuleCat.{w} A, Injective I \u2192 Indecomposable I.obj \u2192 Nonempty (Retract I M) := by\n have := IsArtinianRing.of_finite R A\n refine \u27e8fun hM I hI hIi \u21a6 ?_, fun h \u21a6 ?_\u27e9\n \u00b7 have := FGModuleCat.isLocalRing_end_of_indecomposable hIi\n exact additiveClosure_iff_nonempty_retract.1\n (hM.additiveClosure_of_injective I)\n \u00b7 obtain \u27e8D, hDi, hD\u27e9 := FGModuleCat.exists_injective_isCoseparator R (A := A)\n refine hD.of_additiveClosure (additiveClosure_iff_forall_indecomposable.2 fun Y hY \u27e8r\u27e9 \u21a6 ?_)\n exact h Y r.injective ((FGModuleCat.indecomposable_obj_iff Y).2 hY)\n\n/-- **Generator-cogenerators through indecomposables**: over an Artin algebra, `M` is a\ngenerator-cogenerator of `mod A` exactly when every indecomposable projective and every\nindecomposable injective object of `mod A` is a direct summand of `M`. The modules may live in any\nuniverse in which `A` is small. -/\ntheorem isGeneratorCogenerator_iff_forall_indecomposable (R : Type u) [CommRing R]\n [IsArtinianRing R] {A : Type v} [Ring A] [Algebra R A] [Module.Finite R A] [Small.{w} A]\n (M : FGModuleCat.{w} A) :\n IsGeneratorCogenerator M \u2194\n (\u2200 P : FGModuleCat.{w} A, Projective P \u2192 Indecomposable P.obj \u2192 Nonempty (Retract P M)) \u2227\n \u2200 I : FGModuleCat.{w} A, Injective I \u2192 Indecomposable I.obj \u2192 Nonempty (Retract I M) := by\n have := IsArtinianRing.of_finite R A\n exact isGeneratorCogenerator_iff.trans <| and_congr\n (FGModuleCat.isSeparator_iff_forall_indecomposable M)\n (FGModuleCat.isCoseparator_iff_forall_indecomposable R M)\n\n", "statement": "/-- **`\u2124` is not a coseparator of `mod \u2124`.** -/\ntheorem _root_.FGModuleCat.not_isCoseparator_int : \u00ac IsCoseparator (FGModuleCat.of \u2124 \u2124) ", "proof": " by\n -- Every morphism `\u2124/2\u2124 \u27f6 \u2124` is zero, so the identity of `\u2124/2\u2124` is not detected by them.\n intro h\n have hz : \u2200 g : FGModuleCat.of \u2124 (ZMod 2) \u27f6 FGModuleCat.of \u2124 \u2124, g = 0 := fun g \u21a6 by\n refine ObjectProperty.hom_ext _ (ModuleCat.hom_ext (LinearMap.ext fun x \u21a6 ?_))\n have hx : (2 : \u2124) \u2022 x = 0 := by\n simp [zsmul_eq_mul, CharTwo.two_eq_zero]\n have h2 : (2 : \u2124) \u2022 g.hom.hom x = 0 := by rw [\u2190 map_zsmul, hx, map_zero]\n simpa using h2\n have h1 := (Preadditive.isCoseparator_iff _).1 h (\ud835\udfd9 (FGModuleCat.of \u2124 (ZMod 2)))\n fun g \u21a6 by rw [hz g, Limits.comp_zero]\n have := congr(($h1).hom.hom 1)\n simp at this", "proof_lines": 12, "proof_length": 498, "rev": "75c8aed5fea63047615a25a9763fd5b68a86e891", "heartbeats": 1657, "image": "lean-compression:tauceti-75c8aed5fe-a608030cfc", "split": "dev"} {"path": "TauCeti/Topology/MetricSpace/GromovHausdorff/Length.lean", "module": "TauCeti.Topology.MetricSpace.GromovHausdorff.Length", "theorem": "Filter.Tendsto.isGeodesicSpace_of_ghDist", "prefix": "/-\nCopyright (c) 2026 The Tau Ceti contributors. All rights reserved.\nReleased under Apache 2.0 license as described in the file LICENSE.\nAuthors: Axel Delaval, Zhiyuan Zhang, Leheng Chen\n-/\nmodule\n\npublic import TauCeti.Topology.MetricSpace.GromovHausdorff.Basic\npublic import TauCeti.Topology.MetricSpace.Length.Proper\nimport TauCeti.Topology.MetricSpace.Length.CompactLimit\n\n/-!\n# Length structure of Gromov\u2013Hausdorff limits\n\nCompact Gromov\u2013Hausdorff limits of length spaces are geodesic spaces. The optimal\nGromov\u2013Hausdorff realizations transfer minimizing curves to approximate curves in the target;\ncompactness gives a distance-preserving limit and hence a native geodesic segment.\n\n## References\n\n* D. Burago, Y. Burago and S. Ivanov, *A Course in Metric Geometry*, \u00a77.5.\n* Public formalization references:\n [lean-eval-submissions](https://github.com/frenzymath/lean-eval-submissions) and\n [PoincareConjecture](https://github.com/frenzymath/PoincareConjecture).\n-/\n\npublic section\n\nopen Set Filter Metric\nopen scoped Topology\n\nnamespace Filter.Tendsto\n\nopen TauCeti\n\n", "statement": "/-- A compact Gromov\u2013Hausdorff limit of compact length spaces is geodesic. -/\ntheorem isGeodesicSpace_of_ghDist\n {X : \u2115 \u2192 Type*} [\u2200 n, MetricSpace (X n)] [\u2200 n, CompactSpace (X n)]\n [\u2200 n, Nonempty (X n)] [\u2200 n, IsLengthSpace (X n)]\n {Y : Type*} [MetricSpace Y] [CompactSpace Y] [Nonempty Y]\n (h : Tendsto (fun n \u21a6 GromovHausdorff.ghDist (X n) Y) atTop (\ud835\udcdd 0)) :\n IsGeodesicSpace Y ", "proof": " by\n classical\n let (n : \u2115) : IsGeodesicSpace (X n) := isGeodesicSpace_of_properSpace\n let \u03b4 : \u2115 \u2192 \u211d := fun n \u21a6 GromovHausdorff.ghDist (X n) Y + 1 / ((n : \u211d) + 1)\n have h\u03b4 : Tendsto \u03b4 atTop (\ud835\udcdd 0) := by\n simpa only [add_zero] using h.add (tendsto_one_div_add_atTop_nhds_zero_nat (\ud835\udd5c := \u211d))\n have h2 : Tendsto (fun n \u21a6 2 * \u03b4 n) atTop (\ud835\udcdd 0) := by\n simpa only [mul_zero] using h\u03b4.const_mul 2\n have happ (n : \u2115) : \u2203 f : X n \u2192 Y,\n (\u2200 x y, |dist (f x) (f y) - dist x y| < 2 * \u03b4 n) \u2227\n \u2200 y, \u2203 x, dist (f x) y < 2 * \u03b4 n :=\n TauCeti.exists_approximation_of_ghDist_lt\n (X := X n) (Y := Y) (lt_add_of_pos_right _ (by positivity : 0 < 1 / ((n : \u211d) + 1)))\n choose f hfdist hfcover using happ\n constructor\n intro x y\n choose a ha using fun n \u21a6 hfcover n x\n choose b hb using fun n \u21a6 hfcover n y\n have ha' : Tendsto (fun n \u21a6 f n (a n)) atTop (\ud835\udcdd x) :=\n tendsto_iff_dist_tendsto_zero.mpr <| squeeze_zero (fun _ \u21a6 dist_nonneg)\n (fun n \u21a6 (ha n).le) h2\n have hb' : Tendsto (fun n \u21a6 f n (b n)) atTop (\ud835\udcdd y) :=\n tendsto_iff_dist_tendsto_zero.mpr <| squeeze_zero (fun _ \u21a6 dist_nonneg)\n (fun n \u21a6 (hb n).le) h2\n have hd : Tendsto (fun n \u21a6 dist (a n) (b n)) atTop (\ud835\udcdd (dist x y)) := by\n have he : Tendsto (fun n \u21a6 dist (a n) (b n) - dist (f n (a n)) (f n (b n)))\n atTop (\ud835\udcdd 0) := by\n have hbnd : \u2200 n, \u2016dist (a n) (b n) - dist (f n (a n)) (f n (b n))\u2016 \u2264 2 * \u03b4 n := by\n intro n\n simpa only [Real.norm_eq_abs, abs_sub_comm] using (hfdist n (a n) (b n)).le\n exact squeeze_zero_norm hbnd h2\n simpa only [zero_add, sub_add_cancel] using he.add (ha'.dist hb')\n choose \u03b3 h\u03b3 using fun n \u21a6 IsGeodesicSpace.exists_isGeodesicSegment (a n) (b n)\n apply exists_isGeodesicSegment_of_tendsto_dist (fun n t \u21a6 f n (\u03b3 n t))\n (by simpa only [(h\u03b3 _).source] using ha') (by simpa only [(h\u03b3 _).target] using hb')\n intro s hs t ht\n have he : Tendsto (fun n \u21a6 dist (f n (\u03b3 n s)) (f n (\u03b3 n t)) -\n dist (\u03b3 n s) (\u03b3 n t)) atTop (\ud835\udcdd 0) := by\n have hbnd : \u2200 n, \u2016dist (f n (\u03b3 n s)) (f n (\u03b3 n t)) - dist (\u03b3 n s) (\u03b3 n t)\u2016 \u2264\n 2 * \u03b4 n := by\n intro n\n simpa only [Real.norm_eq_abs] using (hfdist n (\u03b3 n s) (\u03b3 n t)).le\n exact squeeze_zero_norm hbnd h2\n simpa only [zero_add, sub_add_cancel, (h\u03b3 _).dist_eq s hs t ht] using\n he.add (hd.const_mul |s - t|)", "proof_lines": 44, "proof_length": 2137, "rev": "75c8aed5fea63047615a25a9763fd5b68a86e891", "heartbeats": 1590, "image": "lean-compression:tauceti-75c8aed5fe-a608030cfc", "split": "dev"} {"path": "TauCeti/Analysis/InnerProductSpace/LinearPMap/Spectral/Diagonal.lean", "module": "TauCeti.Analysis.InnerProductSpace.LinearPMap.Spectral.Diagonal", "theorem": "HilbertBasis.mem_resolventSet_diagonalPMap_iff", "prefix": "/-\nCopyright (c) 2026 The Tau Ceti contributors. All rights reserved.\nReleased under Apache 2.0 license as described in the file LICENSE.\nAuthors: The Tau Ceti contributors\n-/\nmodule\n\npublic import TauCeti.Analysis.InnerProductSpace.LinearPMap.Diagonal\npublic import TauCeti.Analysis.InnerProductSpace.LinearPMap.Spectral.Cutoff\n\n/-!\n# Spectrum and resolvent of diagonal operators\n\nLet `b` be a Hilbert basis of an inner product space `E` and `c : \u03b9 \u2192 \ud835\udd5c` a family of scalars. The\ndiagonal operator `b.diagonalPMap c` multiplies the `i`-th coordinate by `c i`. This file computes\nits spectral data.\n\n* **Resolvent.** `z \u2022 I - b.diagonalPMap c` has a bounded inverse exactly when `z` stays at a\n positive distance from all the coefficients, `\u03b4 \u2264 \u2016z - c i\u2016` for some `\u03b4 > 0` and every `i`\n (`HilbertBasis.mem_resolventSet_diagonalPMap_iff`). The inverse is then the bounded diagonal\n operator with entries `(z - c i)\u207b\u00b9` (`HilbertBasis.inner_resolvent_diagonalPMap`). Conversely,\n the resolvent sends `b i` to `(z - c i)\u207b\u00b9 \u2022 b i`, so its norm bounds `\u2016z - c i\u2016\u207b\u00b9`.\n* **Spectrum.** Hence the spectrum is the closure of the set of coefficients\n (`HilbertBasis.spectrum_diagonalPMap`). For instance the coefficients `1 / (n + 1)` give the\n spectrum `{0} \u222a {1 / (n + 1)}`, which contains `0` although `0` is not an eigenvalue.\n* **Compact resolvent.** `b.diagonalPMap c` has compact resolvent exactly when the coefficient\n norms form a Northcott family, that is, only finitely many `i` satisfy `\u2016c i\u2016 \u2264 R`, for every `R`\n (`HilbertBasis.hasCompactResolvent_diagonalPMap_iff`). One direction is the finiteness of the\n eigenvalues of an operator with compact resolvent in a bounded set\n (`LinearPMap.HasCompactResolvent.northcott_norm_of_orthonormal`). For the other, the Northcott\n property leaves only finitely many coefficients in the ball of radius `2`, so some real point\n `z` of `[0, 1]` lies outside the closure of the coefficients. The resolvent at `z` is the\n diagonal operator with entries `(z - c i)\u207b\u00b9`, which tend to zero along the cofinite filter, and\n such a diagonal operator is compact (`HilbertBasis.isCompactOperator_diagonal_iff`).\n\nEvery self-adjoint operator with a Hilbert basis of eigenvectors is the diagonal operator of its\neigenvalues (`IsSelfAdjoint.eq_diagonalPMap`), and diagonal operators model the tensor sums\n`A \u2297 1 + 1 \u2297 B` of such operators. The compact resolvent criterion therefore reduces the\ncompactness of the resolvent of a tensor sum to counting pairs of eigenvalues\n(`Northcott.prod_add`).\n\n## Main results\n\n* `HilbertBasis.mem_resolventSet_diagonalPMap_iff`: the resolvent set of a diagonal operator.\n* `HilbertBasis.inner_resolvent_diagonalPMap`: the coordinates of the resolvent.\n* `HilbertBasis.spectrum_diagonalPMap`: the spectrum is the closure of the coefficients.\n* `HilbertBasis.hasCompactResolvent_diagonalPMap_iff`: the compact resolvent criterion.\n\n## References\n\n* M. Reed and B. Simon, *Methods of Modern Mathematical Physics I: Functional Analysis*,\n \u00a7VIII.3 (the spectrum of a multiplication operator is the essential range of the multiplier).\n* M. Reed and B. Simon, *Methods of Modern Mathematical Physics IV: Analysis of Operators*,\n \u00a7XIII.14, Theorem XIII.64 (compact resolvent and eigenvalues tending to infinity).\n-/\n\npublic section\n\nnoncomputable section\n\nopen Filter Topology LinearPMap\nopen scoped ENNReal InnerProductSpace lp\n\nnamespace HilbertBasis\n\nvariable {\u03b9 \ud835\udd5c E : Type*} [RCLike \ud835\udd5c] [NormedAddCommGroup E] [InnerProductSpace \ud835\udd5c E]\n (b : HilbertBasis \u03b9 \ud835\udd5c E) (c : \u03b9 \u2192 \ud835\udd5c) {z : \ud835\udd5c}\n\n/-! ### The resolvent -/\n\n/-- The bounded family `(z - c i)\u207b\u00b9`, for `z` at distance at least `\u03b4 > 0` from every\ncoefficient. -/\nprivate def resolventEntries (z : \ud835\udd5c) {\u03b4 : \u211d} (h\u03b4 : 0 < \u03b4) (hz : \u2200 i, \u03b4 \u2264 \u2016z - c i\u2016) :\n \u2113^\u221e(\u03b9, \ud835\udd5c) :=\n \u27e8fun i \u21a6 (z - c i)\u207b\u00b9, mem\u2113p_infty \u27e8\u03b4\u207b\u00b9, by\n rintro _ \u27e8i, rfl\u27e9\n dsimp only\n rw [norm_inv]\n exact inv_anti\u2080 h\u03b4 (hz i)\u27e9\u27e9\n\nprivate theorem resolventEntries_apply {\u03b4 : \u211d} (h\u03b4 : 0 < \u03b4) (hz : \u2200 i, \u03b4 \u2264 \u2016z - c i\u2016) (i : \u03b9) :\n resolventEntries c z h\u03b4 hz i = (z - c i)\u207b\u00b9 :=\n rfl\n\n/-- The coordinates of the diagonal operator with entries `(z - c i)\u207b\u00b9`. -/\nprivate theorem inner_diagonal_resolventEntries {\u03b4 : \u211d} (h\u03b4 : 0 < \u03b4) (hz : \u2200 i, \u03b4 \u2264 \u2016z - c i\u2016)\n (y : E) (i : \u03b9) :\n \u27eab i, b.diagonal (resolventEntries c z h\u03b4 hz) y\u27eb_\ud835\udd5c = (z - c i)\u207b\u00b9 * \u27eab i, y\u27eb_\ud835\udd5c := by\n rw [\u2190 b.repr_apply_apply, repr_diagonal, b.repr_apply_apply, resolventEntries_apply]\n\n/-- If `z` lies at distance at least `\u03b4 > 0` from every coefficient, the diagonal operator with\nentries `(z - c i)\u207b\u00b9` inverts `z \u2022 I - b.diagonalPMap c`. -/\nprivate theorem isResolventAt_diagonal_resolventEntries {\u03b4 : \u211d} (h\u03b4 : 0 < \u03b4)\n (hz : \u2200 i, \u03b4 \u2264 \u2016z - c i\u2016) :\n IsResolventAt (b.diagonalPMap c) z (b.diagonal (resolventEntries c z h\u03b4 hz)) := by\n have hne (i : \u03b9) : z - c i \u2260 0 := norm_pos_iff.1 (h\u03b4.trans_le (hz i))\n rw [isResolventAt_iff_forall_mem_graph]\n refine \u27e8fun y \u21a6 (b.mem_graph_diagonalPMap_iff c).2 fun i \u21a6 ?_, fun p hp \u21a6 ?_\u27e9\n \u00b7 simp only [inner_sub_right, inner_smul_right, inner_diagonal_resolventEntries]\n field_simp [hne i]\n ring\n \u00b7 have hp' := (b.mem_graph_diagonalPMap_iff c).1 hp\n refine b.repr.injective (lp.ext (funext fun i \u21a6 ?_))\n simp only [b.repr_apply_apply, inner_diagonal_resolventEntries, inner_sub_right,\n inner_smul_right, hp' i]\n field_simp [hne i]\n\n", "statement": "/-- **The resolvent set of a diagonal operator.** `z \u2022 I - b.diagonalPMap c` has a bounded inverse\nif and only if `z` lies at a positive distance from all the coefficients `c i`. -/\ntheorem mem_resolventSet_diagonalPMap_iff :\n z \u2208 (b.diagonalPMap c).resolventSet \u2194 \u2203 \u03b4 > 0, \u2200 i, \u03b4 \u2264 \u2016z - c i\u2016 ", "proof": " by\n refine \u27e8fun h \u21a6 ?_, fun \u27e8\u03b4, h\u03b4, hz\u27e9 \u21a6\n (b.isResolventAt_diagonal_resolventEntries c h\u03b4 hz).mem_resolventSet\u27e9\n set R := (b.diagonalPMap c).resolvent z\n refine \u27e8(\u2016R\u2016 + 1)\u207b\u00b9, by positivity, fun i \u21a6 ?_\u27e9\n have hbi := b.diagonalPMap_apply_self c i\n -- A point of the resolvent set is not an eigenvalue, so `z \u2260 c i`.\n have hne : z - c i \u2260 0 := sub_ne_zero_of_apply_eq_smul h _ (b.orthonormal.ne_zero i) hbi\n -- The resolvent acts on `b i` as multiplication by `(z - c i)\u207b\u00b9`, so this has norm `\u2264 \u2016R\u2016`.\n have hle : \u2016z - c i\u2016\u207b\u00b9 \u2264 \u2016R\u2016 + 1 := by\n have hRb : R (b i) = (z - c i)\u207b\u00b9 \u2022 b i := resolvent_apply_of_apply_eq_smul h _ hbi\n have := R.le_opNorm (b i)\n simp only [hRb, norm_smul, norm_inv, b.orthonormal.1 i, mul_one] at this\n linarith\n exact inv_le_of_inv_le\u2080 (norm_pos_iff.2 hne) hle", "proof_lines": 14, "proof_length": 608, "rev": "75c8aed5fea63047615a25a9763fd5b68a86e891", "heartbeats": 1926, "image": "lean-compression:tauceti-75c8aed5fe-a608030cfc", "split": "dev"} {"path": "TauCeti/LinearAlgebra/Dual/Cogenerator.lean", "module": "TauCeti.LinearAlgebra.Dual.Cogenerator", "theorem": "LinearEquiv.exists_injective_linearMap_pi_of_dual", "prefix": "/-\nCopyright (c) 2026 The Tau Ceti contributors. All rights reserved.\nReleased under Apache 2.0 license as described in the file LICENSE.\nAuthors: The Tau Ceti contributors\n-/\nmodule\n\npublic import Mathlib.LinearAlgebra.Dual.Defs\npublic import Mathlib.RingTheory.Finiteness.Projective\n\n/-!\n# The dual of the regular module as a cogenerator\n\nLet `A` be a semiring with a module structure over a commutative semiring `k`.\nIf a left `A`-module `M` is finite projective over `k` and the scalar actions form a tower,\nevaluating the action of `A` against the coordinates of a `k`-linear embedding of `M` into a\nfinite free `k`-module embeds `M` into a finite power of the dual `D(A_A)` of the right regular\nmodule. This includes every finite-dimensional module over an algebra over a field.\n\n## Main results\n\n* `LinearEquiv.exists_injective_linearMap_pi_of_dual`: if a left `A`-module is identified with\n `D(A_A)`, every left `A`-module that is finite projective over `k` embeds into a finite power\n of it.\n-/\n\npublic section\n\nnamespace LinearEquiv\n\nuniverse u w\n\nvariable {k : Type w} [CommSemiring k]\nvariable {A : Type u} [Semiring A] [Module k A]\nvariable {Q : Type*} [AddCommMonoid Q] [Module A Q] [Module k Q]\n\n", "statement": "/-- **The dual of the right regular module cogenerates finite projective semimodules.** Let `Q`\nbe a left `A`-module identified with `Module.Dual k A` by a `k`-linear equivalence carrying the\naction of `a` to precomposition with right multiplication by `a`. Every left `A`-module that is\nfinite projective over `k`, with compatible scalar actions, embeds `A`-linearly into a finite\npower of `Q`. -/\ntheorem exists_injective_linearMap_pi_of_dual\n (e : Q \u2243\u2097[k] Module.Dual k A)\n (he : \u2200 (a : A) (q : Q) (x : A), e (a \u2022 q) x = e q (x * a)) (M : Type*) [AddCommMonoid M]\n [Module A M] [Module k M] [IsScalarTower k A M] [Module.Projective k M] [Module.Finite k M] :\n \u2203 (n : \u2115) (f : M \u2192\u2097[A] (Fin n \u2192 Q)), Function.Injective f ", "proof": " by\n obtain \u27e8n, -, g, -, hg, -\u27e9 := Module.Finite.exists_comp_eq_id_of_projective k M\n -- The coordinate `i` of `f m` is the functional `x \u21a6 g (x \u2022 m) i`.\n let f\u2080 (m : M) (i : Fin n) : Module.Dual k A :=\n (LinearMap.proj i \u2218\u2097 g) \u2218\u2097 (LinearMap.toSpanSingleton A M m).restrictScalars k\n have hf\u2080 (m : M) (i : Fin n) (x : A) : f\u2080 m i x = g (x \u2022 m) i := rfl\n let f : M \u2192\u2097[A] (Fin n \u2192 Q) :=\n { toFun := fun m i \u21a6 e.symm (f\u2080 m i)\n map_add' := fun _ _ \u21a6 by ext i; apply e.injective; ext; simp [hf\u2080]\n map_smul' := fun _ _ \u21a6 by ext i; apply e.injective; ext; simp [hf\u2080, he, mul_smul] }\n refine \u27e8n, f, fun m m' hm \u21a6 hg (funext fun i \u21a6 ?_)\u27e9\n simpa [f, hf\u2080] using congr(e ($hm i) 1)", "proof_lines": 11, "proof_length": 589, "rev": "75c8aed5fea63047615a25a9763fd5b68a86e891", "heartbeats": 2837, "image": "lean-compression:tauceti-75c8aed5fe-a608030cfc", "split": "dev"} {"path": "TauCeti/Geometry/Manifold/DifferentialOperator/FormalAdjoint/Complex.lean", "module": "TauCeti.Geometry.Manifold.DifferentialOperator.FormalAdjoint.Complex", "theorem": "LinearMap.IsFormalAdjoint.integral_complexInnerSection_eq", "prefix": "/-\nCopyright (c) 2026 The Tau Ceti contributors. All rights reserved.\nReleased under Apache 2.0 license as described in the file LICENSE.\nAuthors: The Tau Ceti contributors\n-/\nmodule\n\npublic import TauCeti.Geometry.Manifold.DifferentialOperator.FormalAdjoint.Basic\nimport TauCeti.Analysis.InnerProductSpace.Complex\nimport TauCeti.Geometry.Manifold.Riemannian.Basic\n\n/-!\n# Formal adjoints of complex-linear operators and the complex pairings\n\nLet `V` and `W` be complex vector bundles over a manifold `M` whose fibres carry real inner\nproducts, and let `\u03bc` be a measure on `M`. Formal adjunction (`LinearMap.IsFormalAdjoint`) is\ndefined with the real inner products. For complex-linear operators `P : \u0393(V) \u2192 \u0393(W)` and\n`Q : \u0393(W) \u2192 \u0393(V)` it also gives the adjoint identity for the complex pairings\n`\u27eas x, r x\u27eb_\u2102 = \u27eas x, r x\u27eb - i \u27eas x, i r x\u27eb` (`ContMDiffSection.complexInnerSection`), the\nHermitian metrics whose real parts are the given inner products when multiplication by `i`\npreserves them: the imaginary part of `\u27eas, r\u27eb_\u2102` is `-\u27eas, i r\u27eb`, and `Q (i r) = i Q r`.\n\n## Main results\n\n* `LinearMap.IsFormalAdjoint.integral_complexInnerSection_eq`: if `Q` is a formal adjoint of `P`\n for the real inner products, then `\u222b \u27eaP a, b\u27eb_\u2102 d\u03bc = \u222b \u27eaa, Q b\u27eb_\u2102 d\u03bc` for compactly supported\n sections `a` and `b`.\n* `LinearMap.IsFormalAdjoint.integral_complexInnerSection_self_eq_ofReal`: for a formally\n self-adjoint `P` and fibre inner products invariant under multiplication by `i`, the integral of\n `\u27eas, P s\u27eb_\u2102` over a compactly supported section `s` is the real number `\u222b \u27eas, P s\u27eb d\u03bc`.\n* `LinearMap.isFormalAdjoint_iff_forall_integral_complexInnerSection_eq`: on a compact manifold\n the converse holds, so formal adjunction of complex-linear operators may be checked on the\n complex pairings.\n-/\n\npublic section\n\nnoncomputable section\n\nopen MeasureTheory Bundle\nopen scoped ContDiff Manifold RealInnerProductSpace\n\nvariable {E : Type*} [NormedAddCommGroup E] [NormedSpace \u211d E]\n {H : Type*} [TopologicalSpace H] {I : ModelWithCorners \u211d E H}\n {M : Type*} [TopologicalSpace M] [ChartedSpace H M]\n {F : Type*} [NormedAddCommGroup F] [NormedSpace \u2102 F]\n {V : M \u2192 Type*} [TopologicalSpace (TotalSpace F V)]\n [\u2200 x, NormedAddCommGroup (V x)] [\u2200 x, InnerProductSpace \u211d (V x)] [\u2200 x, Module \u2102 (V x)]\n [\u2200 x, IsScalarTower \u211d \u2102 (V x)] [FiberBundle F V] [VectorBundle \u211d F V] [VectorBundle \u2102 F V]\n [IsContMDiffRiemannianBundle I \u221e F V]\n {F' : Type*} [NormedAddCommGroup F'] [NormedSpace \u2102 F']\n {W : M \u2192 Type*} [TopologicalSpace (TotalSpace F' W)]\n [\u2200 x, NormedAddCommGroup (W x)] [\u2200 x, InnerProductSpace \u211d (W x)] [\u2200 x, Module \u2102 (W x)]\n [\u2200 x, IsScalarTower \u211d \u2102 (W x)] [FiberBundle F' W] [VectorBundle \u211d F' W] [VectorBundle \u2102 F' W]\n [IsContMDiffRiemannianBundle I \u221e F' W]\n\nnamespace LinearMap\n\n", "statement": "/-- **Integration by parts for the complex pairings.** If the complex-linear operator `Q` is a\nformal adjoint of the complex-linear operator `P` for the real inner products, then\n`\u222b \u27eaP a, b\u27eb_\u2102 d\u03bc = \u222b \u27eaa, Q b\u27eb_\u2102 d\u03bc` for the complex pairings\n(`ContMDiffSection.complexInnerSection`) of compactly supported sections `a` and `b`. -/\ntheorem IsFormalAdjoint.integral_complexInnerSection_eq [MeasurableSpace M]\n [OpensMeasurableSpace M] {\u03bc : Measure M} [IsFiniteMeasureOnCompacts \u03bc]\n {P : C\u209b^\u221e\u27eeI; F, V\u27ef \u2192\u2097[\u2102] C\u209b^\u221e\u27eeI; F', W\u27ef} {Q : C\u209b^\u221e\u27eeI; F', W\u27ef \u2192\u2097[\u2102] C\u209b^\u221e\u27eeI; F, V\u27ef}\n (hPQ : (P.restrictScalars \u211d).IsFormalAdjoint (Q.restrictScalars \u211d) \u03bc)\n {a : C\u209b^\u221e\u27eeI; F, V\u27ef} (ha : IsCompact a.tsupport) {b : C\u209b^\u221e\u27eeI; F', W\u27ef}\n (hb : IsCompact b.tsupport) :\n \u222b x, ContMDiffSection.complexInnerSection (P a) b x \u2202\u03bc =\n \u222b x, ContMDiffSection.complexInnerSection a (Q b) x \u2202\u03bc ", "proof": " by\n -- The real and imaginary parts of the complex pairings are the real pairings `\u27ea\u00b7, \u00b7\u27eb` and\n -- `-\u27ea\u00b7, i \u00b7\u27eb`, whose integrals agree by formal adjunction.\n have h\u2081 := hPQ.integral_inner_eq (s := a) (t := b) (Or.inl ha)\n have h\u2082 := hPQ.integral_inner_eq (s := a) (t := Complex.I \u2022 b) (Or.inl ha)\n simp only [LinearMap.coe_restrictScalars, map_smul, ContMDiffSection.coe_smul_of_normedAlgebra,\n Pi.smul_apply] at h\u2081 h\u2082\n have hl := ContMDiffSection.integrable_complexInnerSection (\u03bc := \u03bc) (s := P a) (Or.inr hb)\n have hr := ContMDiffSection.integrable_complexInnerSection (\u03bc := \u03bc) (r := Q b) (Or.inl ha)\n apply Complex.ext\n \u00b7 rw [\u2190 RCLike.re_to_complex, \u2190 integral_re hl, \u2190 RCLike.re_to_complex, \u2190 integral_re hr]\n simpa [TauCeti.extendRCLike_inner\u2097_apply] using h\u2081\n \u00b7 rw [\u2190 RCLike.im_to_complex, \u2190 integral_im hl, \u2190 RCLike.im_to_complex, \u2190 integral_im hr]\n simpa [TauCeti.extendRCLike_inner\u2097_apply, integral_neg] using h\u2082", "proof_lines": 13, "proof_length": 756, "rev": "75c8aed5fea63047615a25a9763fd5b68a86e891", "heartbeats": 11522, "image": "lean-compression:tauceti-75c8aed5fe-a608030cfc", "split": "dev"} {"path": "TauCeti/Analysis/InnerProductSpace/Positive/Superadditive.lean", "module": "TauCeti.Analysis.InnerProductSpace.Positive.Superadditive", "theorem": "LinearMap.IsPositive.sum_map_eigenvalues_add_sum_map_eigenvalues_le_sum_map_eigenvalues_add", "prefix": "/-\nCopyright (c) 2026 The Tau Ceti contributors. All rights reserved.\nReleased under Apache 2.0 license as described in the file LICENSE.\nAuthors: The Tau Ceti contributors\n-/\nmodule\n\npublic import Mathlib.Analysis.InnerProductSpace.ProdL2\npublic import TauCeti.Analysis.InnerProductSpace.SchurHorn\npublic import TauCeti.Analysis.InnerProductSpace.SingularValues\n\n/-!\n# Superadditivity of convex spectral sums of positive operators\n\nLet `A` and `B` be positive endomorphisms of an `n`-dimensional real or complex inner product\nspace, with eigenvalues `\u03b1\u1d62`, `\u03b2\u1d62` and `\u03b3\u1d62` for `A`, `B` and `A + B`. For a function `\u03c6` convex on\n`[0, \u221e)` with `\u03c6 0 \u2264 0`,\n\n`\u2211\u1d62 \u03c6(\u03b1\u1d62) + \u2211\u1d62 \u03c6(\u03b2\u1d62) \u2264 \u2211\u1d62 \u03c6(\u03b3\u1d62)`,\n\nthat is `tr \u03c6(A) + tr \u03c6(B) \u2264 tr \u03c6(A + B)`, and the inequality reverses for `\u03c6` concave on `[0, \u221e)`\nwith `0 \u2264 \u03c6 0`. For `\u03c6(t) = t\u02b3` these are McCarthy's inequalities\n`tr A\u02b3 + tr B\u02b3 \u2264 tr (A + B)\u02b3` for `1 \u2264 r` and `tr (A + B)\u02b3 \u2264 tr A\u02b3 + tr B\u02b3` for `0 \u2264 r \u2264 1`; the\nconcave case is Rotfel'd's trace inequality. For `0 < r \u2264 1` the concave inequality is the\n`r`-triangle inequality `\u2016A + B\u2016\u1d63\u02b3 \u2264 \u2016A\u2016\u1d63\u02b3 + \u2016B\u2016\u1d63\u02b3` of the Schatten quasi-norms on positive\noperators, and for `1 \u2264 r` the convex one is the reverse bound `\u2016A\u2016\u1d63\u02b3 + \u2016B\u2016\u1d63\u02b3 \u2264 \u2016A + B\u2016\u1d63\u02b3`.\n\n## The argument\n\nPut `V x = (\u221aA x, \u221aB x)`, a map from `E` to the `L\u00b2` product `E \u00d7 E`. Its source Gram operator\n`V\u2020 V` is `A + B`, while its target Gram operator `V V\u2020` acts on the `2n`-dimensional product, and\nits diagonal entries in the orthonormal basis `(v\u1d62, 0)`, `(0, w\u2c7c)` built from eigenbases of `A`\nand `B` are `\u2016\u221aA v\u1d62\u2016\u00b2 = \u03b1\u1d62` and `\u2016\u221aB w\u2c7c\u2016\u00b2 = \u03b2\u2c7c`. The Schur\u2013Horn inequality in Karamata form\n(`LinearMap.IsSymmetric.sum_map_re_inner_apply_self_le_sum_map_eigenvalues`) bounds the sum of\n`\u03c6` over these diagonal entries by its sum over the eigenvalues of `V V\u2020`. Those are the squared\nsingular values of `V`: the eigenvalues `\u03b3\u1d62` of `V\u2020 V = A + B`, followed by `n` zeros, each of\nwhich contributes `\u03c6 0 \u2264 0`.\n\n## Main results\n\n* `LinearMap.IsPositive.sum_map_eigenvalues_add_sum_map_eigenvalues_le_sum_map_eigenvalues_add`:\n the convex inequality.\n* `LinearMap.IsPositive.sum_map_eigenvalues_add_le_sum_map_eigenvalues_add_sum_map_eigenvalues`:\n the concave inequality.\n\n## References\n\n* C. A. McCarthy, *c\u209a*, Israel J. Math. **5** (1967), 249\u2013271.\n* S. Ju. Rotfel'd, *The singular numbers of the sum of completely continuous operators*,\n Topics in Mathematical Physics **3** (1969), 73\u201378.\n* J.-C. Bourin and M. Uchiyama, *A matrix subadditivity inequality for f(A + B) and f(A) + f(B)*,\n Linear Algebra Appl. **423** (2007), 512\u2013518.\n-/\n\npublic section\n\nopen Module (finrank)\nopen scoped InnerProductSpace\n\nnamespace LinearMap.IsPositive\n\nvariable {\ud835\udd5c E : Type*} [RCLike \ud835\udd5c] [NormedAddCommGroup E] [InnerProductSpace \ud835\udd5c E]\n [FiniteDimensional \ud835\udd5c E] {A B : E \u2192\u2097[\ud835\udd5c] E} {n : \u2115}\n\n/-- The column map `x \u21a6 (\u221aA x, \u221aB x)` into the `L\u00b2` product, whose source Gram operator is\n`A + B`. -/\nprivate noncomputable def sqrtColumn (hA : A.IsPositive) (hB : B.IsPositive) :\n E \u2192\u2097[\ud835\udd5c] WithLp 2 (E \u00d7 E) :=\n (WithLp.linearEquiv 2 \ud835\udd5c (E \u00d7 E)).symm.toLinearMap \u2218\u2097 hA.sqrt.prod hB.sqrt\n\nprivate theorem sqrtColumn_apply (hA : A.IsPositive) (hB : B.IsPositive) (x : E) :\n sqrtColumn hA hB x = WithLp.toLp 2 (hA.sqrt x, hB.sqrt x) :=\n (rfl)\n\n/-- The adjoint of the column map is the row map `(x, y) \u21a6 \u221aA x + \u221aB y`. -/\nprivate theorem adjoint_sqrtColumn_toLp (hA : A.IsPositive) (hB : B.IsPositive) (x y : E) :\n adjoint (sqrtColumn hA hB) (WithLp.toLp 2 (x, y)) = hA.sqrt x + hB.sqrt y := by\n refine ext_inner_right \ud835\udd5c fun z \u21a6 ?_\n rw [adjoint_inner_left, sqrtColumn_apply, WithLp.prod_inner_apply, inner_add_left,\n hA.sqrt_isSymmetric, hB.sqrt_isSymmetric]\n\n/-- The source Gram operator of the column map is `A + B`. -/\nprivate theorem adjoint_sqrtColumn_comp_sqrtColumn (hA : A.IsPositive) (hB : B.IsPositive) :\n adjoint (sqrtColumn hA hB) \u2218\u2097 sqrtColumn hA hB = A + B := by\n ext x\n rw [comp_apply, sqrtColumn_apply, adjoint_sqrtColumn_toLp, \u2190 comp_apply, \u2190 comp_apply,\n hA.sqrt_sq, hB.sqrt_sq, LinearMap.add_apply]\n\n/-- The diagonal entries of the target Gram operator of the column map are the quadratic forms\nof `A` and `B`. -/\nprivate theorem re_inner_sqrtColumn_comp_adjoint_apply_self (hA : A.IsPositive)\n (hB : B.IsPositive) (x y : E) :\n RCLike.re \u27ea(sqrtColumn hA hB \u2218\u2097 adjoint (sqrtColumn hA hB)) (WithLp.toLp 2 (x, y)),\n WithLp.toLp 2 (x, y)\u27eb_\ud835\udd5c = \u2016hA.sqrt x + hB.sqrt y\u2016 ^ 2 := by\n rw [comp_apply, \u2190 adjoint_inner_right, adjoint_sqrtColumn_toLp, inner_self_eq_norm_sq]\n\n", "statement": "/-- **Superadditivity of convex spectral sums** (McCarthy; Bourin\u2013Uchiyama). For positive\noperators `A` and `B` on an `n`-dimensional inner product space and a function `\u03c6` convex on\n`[0, \u221e)` with `\u03c6 0 \u2264 0`, `tr \u03c6(A) + tr \u03c6(B) \u2264 tr \u03c6(A + B)`, written as sums over the eigenvalues.\nFor `\u03c6(t) = t\u02b3` with `1 \u2264 r` this is McCarthy's inequality `tr A\u02b3 + tr B\u02b3 \u2264 tr (A + B)\u02b3`. -/\ntheorem sum_map_eigenvalues_add_sum_map_eigenvalues_le_sum_map_eigenvalues_add\n (hA : A.IsPositive) (hB : B.IsPositive) (hn : finrank \ud835\udd5c E = n) {\u03c6 : \u211d \u2192 \u211d}\n (h\u03c6 : ConvexOn \u211d (Set.Ici 0) \u03c6) (h\u03c60 : \u03c6 0 \u2264 0) :\n \u2211 i, \u03c6 (hA.isSymmetric.eigenvalues hn i) + \u2211 i, \u03c6 (hB.isSymmetric.eigenvalues hn i) \u2264\n \u2211 i, \u03c6 ((hA.add hB).isSymmetric.eigenvalues hn i) ", "proof": " by\n set V := sqrtColumn hA hB\n set e := (hA.isSymmetric.eigenvectorBasis hn).prod (hB.isSymmetric.eigenvectorBasis hn)\n have hV := V.isSymmetric_self_comp_adjoint\n -- Schur\u2013Horn for `V V\u2020` in the basis `(v\u1d62, 0)`, `(0, w\u2c7c)`.\n have key := hV.sum_map_re_inner_apply_self_le_sum_map_eigenvalues rfl e h\u03c6\n fun i \u21a6 V.isPositive_self_comp_adjoint.nonneg_eigenvalues rfl i\n -- The diagonal entries are `\u2016\u221aA v\u1d62\u2016\u00b2 = \u03b1\u1d62` and `\u2016\u221aB w\u2c7c\u2016\u00b2 = \u03b2\u2c7c`.\n have hdiag : \u2200 i, RCLike.re \u27ea(V \u2218\u2097 adjoint V) (e i), e i\u27eb_\ud835\udd5c =\n Sum.elim (hA.isSymmetric.eigenvalues hn) (hB.isSymmetric.eigenvalues hn) i := by\n rintro (i | j) <;>\n simp only [e, OrthonormalBasis.prod_apply, Sum.elim_inl, Sum.elim_inr, Function.comp_apply,\n inl_apply, inr_apply, V, re_inner_sqrtColumn_comp_adjoint_apply_self, map_zero, add_zero,\n zero_add, norm_sqrt_eigenvectorBasis_sq]\n simp only [hdiag, Fintype.sum_sum_type, Sum.elim_inl, Sum.elim_inr] at key\n refine key.trans ?_\n -- The eigenvalues of `V V\u2020` are the squared singular values of `V`: those of `V\u2020 V = A + B`,\n -- then zeros.\n have hnm : n \u2264 finrank \ud835\udd5c (WithLp 2 (E \u00d7 E)) := by\n rw [Module.finrank_eq_card_basis e.toBasis]\n simp\n rw [Finset.sum_congr rfl fun i _ \u21a6 by\n rw [\u2190 V.sq_singularValues_eq_eigenvalues_self_comp_adjoint rfl i.isLt],\n Fin.sum_univ_eq_sum_range (fun i \u21a6 \u03c6 (V.singularValues i ^ 2)),\n \u2190 Finset.sum_range_add_sum_Ico _ hnm, \u2190 Fin.sum_univ_eq_sum_range]\n have htail :\n \u2211 i \u2208 Finset.Ico n (finrank \ud835\udd5c (WithLp 2 (E \u00d7 E))), \u03c6 (V.singularValues i ^ 2) \u2264 0 :=\n Finset.sum_nonpos fun i hi \u21a6 by\n rw [V.singularValues_of_finrank_le (hn.trans_le (Finset.mem_Ico.mp hi).1)]\n simpa using h\u03c60\n refine (add_le_of_nonpos_right htail).trans_eq (Finset.sum_congr rfl fun i _ \u21a6 ?_)\n rw [V.sq_singularValues_fin hn,\n LinearMap.IsSymmetric.eigenvalues_congr (adjoint_sqrtColumn_comp_sqrtColumn hA hB)]", "proof_lines": 32, "proof_length": 1538, "rev": "75c8aed5fea63047615a25a9763fd5b68a86e891", "heartbeats": 4239, "image": "lean-compression:tauceti-75c8aed5fe-a608030cfc", "split": "dev"} {"path": "TauCeti/LinearAlgebra/Determinant/Quotient.lean", "module": "TauCeti.LinearAlgebra.Determinant.Quotient", "theorem": "LinearMap.det_eq_det_mul_det_of_exact", "prefix": "/-\nCopyright (c) 2026 The Tau Ceti contributors. All rights reserved.\nReleased under Apache 2.0 license as described in the file LICENSE.\nAuthors: The Tau Ceti contributors\n-/\nmodule\n\npublic import Mathlib.Algebra.Exact.Basic\npublic import Mathlib.LinearAlgebra.Determinant\npublic import Mathlib.LinearAlgebra.Projection\nimport Mathlib.Algebra.Module.Projective\n\n/-!\n# The determinant of an endomorphism induced on a quotient\n\nAn endomorphism `f` of a module `M` that preserves a submodule `p` induces an endomorphism\n`Submodule.mapQ p p f _` of `M \u29f8 p`. Given a complement `q` of `p`, the determinant of that\ninduced endomorphism equals the determinant of the **compression** of `f` to `q`: inclusion into\n`M`, then `f`, then projection onto `q` along `p`. This gives a basis-free handle on the quotient\ndeterminant inside `M` itself, where it can be computed and varies continuously with `f`.\n\nThe same block-triangular computation, Mathlib's `LinearMap.det_eq_det_mul_det`, is restated for\na short exact sequence `0 \u2192 M' \u2192 M \u2192 M'' \u2192 0` of free modules and compatible endomorphisms of its\nthree terms: the determinant on `M` is the product of the determinants on `M'` and `M''`. This is\nthe form in which it is applied to sequences of modules with an action, where the submodule and\nthe quotient are given as modules in their own right rather than as `range i` and `M \u29f8 range i`.\n\n## Main results\n\n* `LinearMap.det_mapQ_of_isCompl`: the determinant of the endomorphism induced on `M \u29f8 p` is the\n determinant of the compression to a complement of `p`.\n* `LinearMap.det_eq_det_mul_det_of_exact`: the determinant is multiplicative along a short exact\n sequence of free modules.\n-/\n\npublic section\n\nnamespace LinearMap\n\nvariable {R M : Type*} [CommRing R] [AddCommGroup M] [Module R M]\n\n/-- **The determinant of a quotient endomorphism is that of its compression to a complement.** -/\ntheorem det_mapQ_of_isCompl {p q : Submodule R M} (hpq : IsCompl p q) (f : M \u2192\u2097[R] M)\n (hf : p \u2264 p.comap f) :\n LinearMap.det (Submodule.mapQ p p f hf) =\n LinearMap.det (q.projectionOnto p hpq.symm \u2218\u2097 f \u2218\u2097 q.subtype) := by\n rw [\u2190 LinearMap.det_conj (Submodule.mapQ p p f hf) (Submodule.quotientEquivOfIsCompl p q hpq)]\n refine congrArg LinearMap.det (LinearMap.ext fun x => ?_)\n simp only [LinearMap.coe_comp, LinearEquiv.coe_coe, Function.comp_apply, Submodule.coe_subtype,\n Submodule.quotientEquivOfIsCompl_symm_apply, Submodule.mapQ_apply,\n Submodule.quotientEquivOfIsCompl_apply_mk]\n\nsection Exact\n\nvariable {M' M'' : Type*} [AddCommGroup M'] [Module R M'] [AddCommGroup M''] [Module R M'']\n\n", "statement": "/-- **The determinant is multiplicative along a short exact sequence.** Let\n`0 \u2192 M' \u2192 M \u2192 M'' \u2192 0` be a short exact sequence, given by an injective `i`, a surjective `p` and\n`Function.Exact i p`, with `M` finite and `M'`, `M''` free. If endomorphisms `f'`, `f` and `f''`\nof the three terms are intertwined by `i` and `p`, then `det f = det f' * det f''`. -/\ntheorem det_eq_det_mul_det_of_exact [Module.Finite R M] [Module.Free R M'] [Module.Free R M'']\n {i : M' \u2192\u2097[R] M} {p : M \u2192\u2097[R] M''} (hi : Function.Injective i) (hip : Function.Exact i p)\n (hp : Function.Surjective p) {f : M \u2192\u2097[R] M} {f' : M' \u2192\u2097[R] M'} {f'' : M'' \u2192\u2097[R] M''}\n (hf' : f \u2218\u2097 i = i \u2218\u2097 f') (hf'' : p \u2218\u2097 f = f'' \u2218\u2097 p) :\n f.det = f'.det * f''.det ", "proof": " by\n -- The sequence splits because `M''` is projective, so `M'` is a quotient of the finite `M`.\n obtain \u27e8s, hs\u27e9 := Module.projective_lifting_property p LinearMap.id hp\n have e := (hip.splitSurjectiveEquiv hi \u27e8s, hs\u27e9).val\n have : Module.Finite R M' := .of_surjective (fst R M' M'' \u2218\u2097 e.toLinearMap)\n (Prod.fst_surjective.comp e.surjective)\n -- Identify `M'` with `range i` and `M''` with `M \u29f8 range i`, and apply Mathlib's block form.\n let W := LinearMap.range i\n have hW : W \u2264 W.comap f := by\n rintro _ \u27e8x, rfl\u27e9\n exact \u27e8f' x, (congr($hf' x)).symm\u27e9\n let e' : M' \u2243\u2097[R] W := LinearEquiv.ofInjective i hi\n let e'' : (M \u29f8 W) \u2243\u2097[R] M'' :=\n (Submodule.quotEquivOfEq _ _ hip.linearMap_ker_eq.symm).trans (p.quotKerEquivOfSurjective hp)\n have : Module.Free R W := .of_equiv e'\n have : Module.Finite R W := .equiv e'\n have : Module.Free R (M \u29f8 W) := .of_equiv e''.symm\n rw [LinearMap.det_eq_det_mul_det W f hW, \u2190 LinearMap.det_conj f' e',\n \u2190 LinearMap.det_conj f'' e''.symm]\n congr 2\n \u00b7 ext x\n obtain \u27e8y, rfl\u27e9 := e'.surjective x\n simp only [restrict_apply, coe_comp, LinearEquiv.coe_coe, Function.comp_apply,\n LinearEquiv.symm_apply_apply, Submodule.coe_mk, e']\n exact congr($hf' y)\n \u00b7 ext x\n apply e''.injective\n simpa [e''] using congr($hf'' x)", "proof_lines": 27, "proof_length": 1023, "rev": "75c8aed5fea63047615a25a9763fd5b68a86e891", "heartbeats": 3238, "image": "lean-compression:tauceti-75c8aed5fe-a608030cfc", "split": "dev"} {"path": "TauCeti/RepresentationTheory/Homological/ContCohomology/Cup/TrivialFp/Form.lean", "module": "TauCeti.RepresentationTheory.Homological.ContCohomology.Cup.TrivialFp.Form", "theorem": "LinearMap.nondegenerate_cupForm_iff_of_injective", "prefix": "/-\nCopyright (c) 2026 The Tau Ceti contributors. All rights reserved.\nReleased under Apache 2.0 license as described in the file LICENSE.\nAuthors: The Tau Ceti contributors\n-/\nmodule\n\npublic import Mathlib.LinearAlgebra.BilinearForm.Properties\npublic import TauCeti.RepresentationTheory.Homological.ContCohomology.Cup.TrivialFp.Basic\n\n/-!\n# The cup form of a linear functional on `H\u00b2(G, \ud835\udd3d_p)`\n\nComposing the cup square `cupFp p G : H\u00b9(G, \ud835\udd3d_p) \u00d7 H\u00b9(G, \ud835\udd3d_p) \u2192 H\u00b2(G, \ud835\udd3d_p)` with a linear\nfunctional `\u03c6 : H\u00b2(G, \ud835\udd3d_p) \u2192\u2097 \ud835\udd3d_p` gives an `\ud835\udd3d_p`-bilinear form `(a, b) \u21a6 \u03c6 (a \u2323 b)` on\n`H\u00b9(G, \ud835\udd3d_p)`, the **cup form** `\u03c6.cupForm`. It is the object through which Mathlib's theory of\nbilinear forms \u2014 alternation, symmetry, nondegeneracy, matrices with respect to a basis \u2014 applies to\nthe cup product; a Demushkin group is a pro-`p` group whose cup form, for an isomorphism\n`\u03c6 : H\u00b2(G, \ud835\udd3d_p) \u2245 \ud835\udd3d_p`, is nondegenerate.\n\nGraded commutativity of the cup square makes the cup form skew-symmetric, hence reflexive; at an\nodd prime every cup square `a \u2323 a` vanishes (`TauCeti.cupFp_self_eq_zero_of_ne_two`) and the\nform is alternating, while at `p = 2` it is symmetric. When `\u03c6` is injective the form is\nalternating exactly when every cup square vanishes and nondegenerate exactly when the cup square\nseparates points, so neither property depends on the choice of `\u03c6`: replacing `\u03c6` by a nonzero\nmultiple rescales the form and changes nothing below.\n\n## Main definitions\n\n* `LinearMap.cupForm`: the bilinear form `(a, b) \u21a6 \u03c6 (a \u2323 b)` on `H\u00b9(G, \ud835\udd3d_p)`.\n\n## Main results\n\n* `LinearMap.cupForm_gradedComm`, `LinearMap.isRefl_cupForm`: the cup form is skew-symmetric and\n reflexive.\n* `LinearMap.isAlt_cupForm_of_ne_two`, `LinearMap.isSymm_cupForm_two`: it is alternating at an odd\n prime and symmetric at `p = 2`.\n* `LinearMap.isAlt_cupForm_iff_of_injective`, `LinearMap.nondegenerate_cupForm_iff_of_injective`:\n for injective `\u03c6`, alternation is the vanishing of all cup squares and nondegeneracy is the\n separating property of the cup square, independently of `\u03c6`.\n\n## References\n\n* J. P. Labute, *Classification of Demushkin groups*, Canad. J. Math. 19 (1967), 106\u2013132, p. 106.\n* J.-P. Serre, *Galois Cohomology*, Chapter I, \u00a74.5.\n-/\n\npublic section\n\nopen TauCeti\n\nnamespace LinearMap\n\nuniverse u\n\nvariable {p : \u2115} {G : Type u} [Group G] [TopologicalSpace G] [IsTopologicalGroup G]\n\n/-! ### The cup form\n\nThe form is a construction on the linear functional `\u03c6`, so it and its lemmas live in the\n`LinearMap` namespace: `\u03c6.cupForm`. -/\n\n/-- **The cup form** of a linear functional `\u03c6 : H\u00b2(G, \ud835\udd3d_p) \u2192\u2097 \ud835\udd3d_p`: the `\ud835\udd3d_p`-bilinear form\n`(a, b) \u21a6 \u03c6 (a \u2323 b)` on `H\u00b9(G, \ud835\udd3d_p)`. For a Demushkin group, where `H\u00b2(G, \ud835\udd3d_p)` is\none-dimensional, an isomorphism `\u03c6 : H\u00b2(G, \ud835\udd3d_p) \u2245 \ud835\udd3d_p` turns the cup square into the\nnondegenerate bilinear form of Labute's definition. -/\nnoncomputable def cupForm (\u03c6 : cohomFp p G 2 \u2192\u2097[ZMod p] ZMod p) :\n LinearMap.BilinForm (ZMod p) (cohomFp p G 1) :=\n (cupFp p G).compr\u2082 \u03c6\n\n@[simp]\ntheorem cupForm_apply (\u03c6 : cohomFp p G 2 \u2192\u2097[ZMod p] ZMod p)\n (a b : cohomFp p G 1) : \u03c6.cupForm a b = \u03c6 (cupFp p G a b) := by\n simp only [LinearMap.cupForm, LinearMap.compr\u2082_apply]\n\n/-- Rescaling the functional rescales the cup form. -/\n@[simp]\ntheorem cupForm_smul (c : ZMod p) (\u03c6 : cohomFp p G 2 \u2192\u2097[ZMod p] ZMod p) :\n (c \u2022 \u03c6).cupForm = c \u2022 \u03c6.cupForm := by\n ext a b\n simp\n\n/-- **The cup form is skew-symmetric**, by graded commutativity of the cup square. -/\ntheorem cupForm_gradedComm (\u03c6 : cohomFp p G 2 \u2192\u2097[ZMod p] ZMod p)\n (a b : cohomFp p G 1) : \u03c6.cupForm a b = -\u03c6.cupForm b a := by\n rw [LinearMap.cupForm_apply, LinearMap.cupForm_apply, cupFp_gradedComm, map_neg]\n\n/-- The cup form is reflexive: `\u03c6 (a \u2323 b) = 0` implies `\u03c6 (b \u2323 a) = 0`. -/\ntheorem isRefl_cupForm (\u03c6 : cohomFp p G 2 \u2192\u2097[ZMod p] ZMod p) :\n \u03c6.cupForm.IsRefl :=\n fun a b h => by rw [LinearMap.cupForm_gradedComm, h, neg_zero]\n\n/-- The cup form is alternating exactly when `\u03c6` kills every cup square. -/\ntheorem isAlt_cupForm_iff (\u03c6 : cohomFp p G 2 \u2192\u2097[ZMod p] ZMod p) :\n \u03c6.cupForm.IsAlt \u2194 \u2200 a : cohomFp p G 1, \u03c6 (cupFp p G a a) = 0 := by\n unfold LinearMap.BilinForm.IsAlt LinearMap.IsAlt\n simp only [LinearMap.cupForm_apply]\n\n/-- For injective `\u03c6`, the cup form is alternating exactly when every cup square `a \u2323 a`\nvanishes; in particular alternation does not depend on the choice of `\u03c6`. -/\ntheorem isAlt_cupForm_iff_of_injective (\u03c6 : cohomFp p G 2 \u2192\u2097[ZMod p] ZMod p)\n (h\u03c6 : Function.Injective \u03c6) :\n \u03c6.cupForm.IsAlt \u2194 \u2200 a : cohomFp p G 1, cupFp p G a a = 0 := by\n simp only [LinearMap.isAlt_cupForm_iff, map_eq_zero_iff \u03c6 h\u03c6]\n\n/-- **At an odd prime the cup form is alternating.** -/\ntheorem isAlt_cupForm_of_ne_two [Fact p.Prime]\n (\u03c6 : cohomFp p G 2 \u2192\u2097[ZMod p] ZMod p) (hp : p \u2260 2) : \u03c6.cupForm.IsAlt := fun a => by\n rw [LinearMap.cupForm_apply, cupFp_self_eq_zero_of_ne_two p G hp, map_zero]\n\n/-- **At `p = 2` the cup form is symmetric**: skew-symmetry is symmetry in characteristic two. -/\ntheorem isSymm_cupForm_two (\u03c6 : cohomFp 2 G 2 \u2192\u2097[ZMod 2] ZMod 2) :\n \u03c6.cupForm.IsSymm :=\n LinearMap.BilinForm.isSymm_def.mpr fun a b => by\n rw [LinearMap.cupForm_gradedComm, ZMod.neg_eq_self_mod_two]\n\n", "statement": "/-- **For injective `\u03c6`, the cup form is nondegenerate exactly when the cup square separates\npoints on the left**: every nonzero class `a` has some `b` with `a \u2323 b \u2260 0`. By reflexivity the\nright-separating condition is automatic, and nondegeneracy does not depend on the choice of\n`\u03c6`. -/\ntheorem nondegenerate_cupForm_iff_of_injective\n (\u03c6 : cohomFp p G 2 \u2192\u2097[ZMod p] ZMod p) (h\u03c6 : Function.Injective \u03c6) :\n \u03c6.cupForm.Nondegenerate \u2194\n \u2200 a : cohomFp p G 1, a \u2260 0 \u2192 \u2203 b : cohomFp p G 1, cupFp p G a b \u2260 0 ", "proof": " by\n -- `LinearMap.BilinForm.Nondegenerate` is an abbreviation for `LinearMap.Nondegenerate`\n refine \u03c6.isRefl_cupForm.nondegenerate_iff_separatingLeft.trans ?_\n constructor\n \u00b7 intro h a ha\n by_contra hb\n push Not at hb\n exact ha (h a fun b => by rw [LinearMap.cupForm_apply, hb b, map_zero])\n \u00b7 intro h a ha\n by_contra hne\n obtain \u27e8b, hb\u27e9 := h a hne\n have hab := ha b\n rw [LinearMap.cupForm_apply] at hab\n exact hb ((map_eq_zero_iff \u03c6 h\u03c6).mp hab)", "proof_lines": 13, "proof_length": 344, "rev": "75c8aed5fea63047615a25a9763fd5b68a86e891", "heartbeats": 880, "image": "lean-compression:tauceti-75c8aed5fe-a608030cfc", "split": "dev"} {"path": "TauCeti/LinearAlgebra/Matrix/Determinant/Interlacing.lean", "module": "TauCeti.LinearAlgebra.Matrix.Determinant.Interlacing", "theorem": "Matrix.det_interlacing_indicator", "prefix": "/-\nCopyright (c) 2026 The Tau Ceti contributors. All rights reserved.\nReleased under Apache 2.0 license as described in the file LICENSE.\nAuthors: The Tau Ceti contributors\n-/\nmodule\n\npublic import Mathlib.LinearAlgebra.Matrix.Determinant.Basic\npublic import Mathlib.Order.Monotone.Defs\n\n/-!\n# Interlacing as a determinant of indicators\n\nTwo weakly decreasing sequences `x` and `y` of length `k` in a linear order *interlace* if\n`x 0 > y 0 \u2265 x 1 > y 1 \u2265 \u22ef \u2265 x (k - 1) > y (k - 1)`. This file shows that interlacing is detected\nby a determinant: the `k \u00d7 k` matrix with `(b, c)` entry `1` if `y c < x b` and `0` otherwise has\ndeterminant `1` if `x` and `y` interlace, and `0` otherwise\n(`Matrix.det_interlacing_indicator`).\n\nIn `TauCeti.MeasureTheory.Measure.Lebesgue.PieriCone` the statement turns the indicator of a cone\nof interlacing inequalities into an alternating sum over permutations.\n\n## Provenance\n\nThe statement and the expansion along the first column are adapted from the lemma\n`New.det_interlacing_indicator` of grh-lean (https://github.com/lsernau/grh-lean,\n`src/New/UpperBound/ElementaryDivisors/PieriCone.lean`, Apache 2.0, Copyright 2026 Anthropic,\nPBC), there stated for real sequences and real matrices.\n-/\n\npublic section\n\nopen Finset\n\nnamespace Matrix\n\nvariable {R \u03b1 : Type*} [CommRing R] [LinearOrder \u03b1]\n\n", "statement": "/-- For weakly decreasing `x` and `y` in `\u03b1 ^ k`, the matrix with `(b, c)` entry `1` if\n`y c < x b` and `0` otherwise has determinant `1` if the two interlace,\n`x 0 > y 0 \u2265 x 1 > y 1 \u2265 \u22ef`, and `0` otherwise. -/\ntheorem det_interlacing_indicator {k : \u2115} {x y : Fin k \u2192 \u03b1} (hx : Antitone x)\n (hy : Antitone y) :\n det (of fun b c : Fin k \u21a6 if y c < x b then (1 : R) else 0) =\n if (\u2200 b : Fin k, y b < x b) \u2227 \u2200 b c : Fin k, b.val + 1 = c.val \u2192 x c \u2264 y b then 1\n else 0 ", "proof": " by\n induction k with\n | zero => simp\n | succ k ih =>\n obtain \u27e8b, hb\u27e9 | h_none := exists_or_forall_not fun b : Fin k \u21a6 y 0 < x b.succ\n \u00b7 -- If `y 0 < x b.succ`, rows `0` and `b.succ` consist of ones, and interlacing fails.\n have h_row_succ (c : Fin (k + 1)) : y c < x b.succ := (hy c.zero_le).trans_lt hb\n have h_row_zero (c : Fin (k + 1)) : y c < x 0 :=\n (h_row_succ c).trans_le (hx b.succ.zero_le)\n rw [ite_eq_right fun \u27e8_, h_le\u27e9 \u21a6\n (h_row_succ b.castSucc).not_ge (h_le b.castSucc b.succ rfl)]\n exact det_zero_of_row_eq b.succ_ne_zero (funext fun c \u21a6 by simp [h_row_succ, h_row_zero])\n \u00b7 -- Otherwise column `0` vanishes below the top: expand along it.\n have h_expand : det (of fun b c : Fin (k + 1) \u21a6 if y c < x b then (1 : R) else 0) =\n (if y 0 < x 0 then 1 else 0) *\n det (of fun b c : Fin k \u21a6 if y c.succ < x b.succ then (1 : R) else 0) := by\n simp [det_succ_column_zero, Fin.sum_univ_succ, h_none]\n -- The minor `(of f).submatrix Fin.succ Fin.succ` is, by the definitions of `submatrix`\n -- and `of`, the matrix `of fun b c \u21a6 f b.succ c.succ`.\n rfl\n rw [h_expand, ih (x := fun b \u21a6 x b.succ) (y := fun b \u21a6 y b.succ)\n (hx.comp_monotone (Fin.strictMono_succ).monotone)\n (hy.comp_monotone (Fin.strictMono_succ).monotone)]\n -- As every `x b.succ \u2264 y 0`, interlacing is `y 0 < x 0` and interlacing of the tails.\n have h_split : ((\u2200 b : Fin (k + 1), y b < x b) \u2227\n \u2200 b c : Fin (k + 1), b.val + 1 = c.val \u2192 x c \u2264 y b) \u2194\n y 0 < x 0 \u2227 (\u2200 b : Fin k, y b.succ < x b.succ) \u2227\n \u2200 b c : Fin k, b.val + 1 = c.val \u2192 x c.succ \u2264 y b.succ := by\n simp [Fin.forall_fin_succ, fun b : Fin k \u21a6 not_lt.1 (h_none b), and_assoc]\n simp only [h_split, ite_zero_mul_ite_zero, mul_one]", "proof_lines": 29, "proof_length": 1246, "rev": "75c8aed5fea63047615a25a9763fd5b68a86e891", "heartbeats": 2787, "image": "lean-compression:tauceti-75c8aed5fe-a608030cfc", "split": "dev"} {"path": "TauCeti/MeasureTheory/Function/BoundedVariation.lean", "module": "TauCeti.MeasureTheory.Function.BoundedVariation", "theorem": "Measurable.eVariationOn_Icc", "prefix": "/-\nCopyright (c) 2026 The Tau Ceti contributors. All rights reserved.\nReleased under Apache 2.0 license as described in the file LICENSE.\nAuthors: The Tau Ceti contributors\n-/\nmodule\n\npublic import TauCeti.Topology.EMetricSpace.BoundedVariation\npublic import Mathlib.MeasureTheory.Constructions.BorelSpace.ContinuousMap\npublic import Mathlib.MeasureTheory.Constructions.BorelSpace.Order\n\n/-!\n# Measurability of path variation\n\nA family of continuous paths with measurable evaluations has measurable total variation.\nThis includes infinite variation and therefore also makes the event of bounded variation\nmeasurable. Restriction to a compact time interval gives the finite-horizon form used for\nvariation processes of adapted continuous paths.\n\nThe path-space step uses Mathlib's evaluation-generated Borel sigma algebra on continuous maps;\nlower semicontinuity of variation then supplies measurability without choosing partitions.\n-/\n\npublic section\n\nopen MeasureTheory Set\n\nnamespace Measurable\n\nvariable {\u03a9 \u03b1 E : Type*} [MeasurableSpace \u03a9] [LinearOrder \u03b1] [TopologicalSpace \u03b1]\n [SecondCountableTopology \u03b1] [LocallyCompactSpace \u03b1]\n [PseudoMetricSpace E] [SecondCountableTopology E] [MeasurableSpace E] [BorelSpace E]\n {X : \u03b1 \u2192 \u03a9 \u2192 E}\n\n/-- Total variation of a continuous random path is measurable, even when it is infinite. -/\ntheorem eVariationOn (hX : \u2200 t, Measurable (X t))\n (hc : \u2200 \u03c9, Continuous (fun t => X t \u03c9)) (s : Set \u03b1) :\n Measurable (fun \u03c9 => eVariationOn (fun t => X t \u03c9) s) := by\n let F : \u03a9 \u2192 C(\u03b1, E) := fun \u03c9 => \u27e8fun t => X t \u03c9, hc \u03c9\u27e9\n have hF : Measurable F := ContinuousMap.measurable_iff_eval.mpr hX\n exact (ContinuousMap.lowerSemicontinuous_eVariationOn s).measurable.comp hF\n\n", "statement": "/-- Variation on a closed interval is measurable when evaluations are measurable and paths\nare continuous on that interval. No bounded-variation assumption is needed. -/\ntheorem eVariationOn_Icc [OrderClosedTopology \u03b1] {a b : \u03b1}\n (hX : \u2200 t \u2208 Icc a b, Measurable (X t))\n (hc : \u2200 \u03c9, ContinuousOn (fun t => X t \u03c9) (Icc a b)) :\n Measurable (fun \u03c9 => _root_.eVariationOn (fun t => X t \u03c9) (Icc a b)) ", "proof": " by\n let : LocallyCompactSpace (Icc a b) := isClosed_Icc.locallyCompactSpace\n have hm := Measurable.eVariationOn (X := fun t : Icc a b => X t)\n (fun t => hX t t.property) (fun \u03c9 => (hc \u03c9).domRestrict) univ\n have he (\u03c9 : \u03a9) :\n _root_.eVariationOn (fun t : Icc a b => X t \u03c9) univ =\n _root_.eVariationOn (fun t => X t \u03c9) (Icc a b) := by\n convert _root_.eVariationOn.comp_eq_of_monotoneOn (t := univ) (fun t => X t \u03c9)\n (Subtype.val : Icc a b \u2192 \u03b1) (fun _ _ _ _ h => h) using 1\n \u00b7 rfl\n \u00b7 congr 1\n exact (Subtype.coe_image_univ _).symm\n simpa only [he] using hm", "proof_lines": 12, "proof_length": 541, "rev": "75c8aed5fea63047615a25a9763fd5b68a86e891", "heartbeats": 401, "image": "lean-compression:tauceti-75c8aed5fe-a608030cfc", "split": "dev"} {"path": "TauCeti/MeasureTheory/Function/StronglyMeasurable/Basic.lean", "module": "TauCeti.MeasureTheory.Function.StronglyMeasurable.Basic", "theorem": "MeasureTheory.FinStronglyMeasurable.of_tendsto_const_zero", "prefix": "/-\nCopyright (c) 2026 The Tau Ceti contributors. All rights reserved.\nReleased under Apache 2.0 license as described in the file LICENSE.\nAuthors: The Tau Ceti contributors\n-/\nmodule\n\npublic import Mathlib.MeasureTheory.Function.StronglyMeasurable.Basic\npublic import TauCeti.MeasureTheory.Constructions.BorelSpace.Basic\n\n/-!\n# Strong measurability and finite-support approximation\n\nA continuous function from a space with the Borel `\u03c3`-algebra to a pseudo-metrizable space is\nstrongly measurable as soon as its range lies in a compact set, since the range is then separable.\nNo countability assumption on the domain is needed.\n\nStrong measurability also descends along a surjective local homeomorphism out of a Lindel\u00f6f\nspace: a function on its codomain is strongly measurable exactly when its composite with the local\nhomeomorphism is. Extending an `m\u03a9`-strongly measurable function by zero outside a set `T` gives\nan `mProd`-strongly measurable function on `\u03b9 \u00d7 \u03a9` whenever `T \u00d7\u02e2 A` is `mProd`-measurable for all\n`m\u03a9`-measurable `A`.\n\nFinite-support approximation transfers between strongly measurable functions whenever\nconvergence of the constant zero sequence to the first implies convergence to the second.\n\n## Main results\n\n* `Continuous.stronglyMeasurable_of_range_subset_isCompact`: a continuous function whose range\n lies in a compact set is strongly measurable.\n* `IsLocalHomeomorph.stronglyMeasurable_comp_iff`: `g \u2218 f` is strongly measurable exactly when\n `g` is, for a surjective local homeomorphism `f` out of a Lindel\u00f6f space.\n* `MeasureTheory.StronglyMeasurable.indicator_prod`: extending an `m\u03a9`-strongly measurable\n function by zero outside a set `T` preserves strong measurability on `\u03b9 \u00d7 \u03a9` when measurable\n rectangles `T \u00d7\u02e2 A` are `mProd`-measurable.\n* `MeasureTheory.FinStronglyMeasurable.of_tendsto_const_zero`: transfer finite-support\n approximation using convergence of constant zero sequences.\n-/\n\npublic section\n\nopen MeasureTheory TopologicalSpace\n\nopen scoped Topology\n\n/-- A continuous function whose range lies in a compact set is strongly measurable, without any\ncountability assumption on the domain. -/\ntheorem Continuous.stronglyMeasurable_of_range_subset_isCompact {X Z : Type*}\n [MeasurableSpace X] [TopologicalSpace X] [OpensMeasurableSpace X] [TopologicalSpace Z]\n [PseudoMetrizableSpace Z] {u : X \u2192 Z} (hu : Continuous u) {s : Set Z} (hs : IsCompact s)\n (hus : \u2200 x, u x \u2208 s) : StronglyMeasurable u := by\n borelize Z\n refine stronglyMeasurable_iff_measurable_separable.2 \u27e8hu.measurable, ?_\u27e9\n exact (hs.isSeparable).mono (Set.range_subset_iff.2 hus)\n\n/-- For a surjective local homeomorphism `f` out of a Lindel\u00f6f space, a map `g` out of the\ncodomain of `f` is strongly measurable exactly when `g \u2218 f` is. -/\ntheorem IsLocalHomeomorph.stronglyMeasurable_comp_iff {\u03b1 \u03b2 \u03b3 : Type*} [TopologicalSpace \u03b1]\n [MeasurableSpace \u03b1] [BorelSpace \u03b1] [LindelofSpace \u03b1] [TopologicalSpace \u03b2]\n [MeasurableSpace \u03b2] [BorelSpace \u03b2] [TopologicalSpace \u03b3] [PseudoMetrizableSpace \u03b3]\n {f : \u03b1 \u2192 \u03b2} (hf : IsLocalHomeomorph f) (hsurj : Function.Surjective f) {g : \u03b2 \u2192 \u03b3} :\n StronglyMeasurable (g \u2218 f) \u2194 StronglyMeasurable g := by\n borelize \u03b3\n simp only [stronglyMeasurable_iff_measurable_separable, hf.measurable_comp_iff hsurj,\n hsurj.range_comp]\n\n/-- Extending an `m\u03a9`-strongly measurable function `a` by zero outside a set `T` yields an\n`mProd`-strongly measurable function on `\u03b9 \u00d7 \u03a9`, provided every `m\u03a9`-measurable rectangle `T \u00d7\u02e2 A`\nis `mProd`-measurable. -/\ntheorem MeasureTheory.StronglyMeasurable.indicator_prod\n {\u03b9 \u03a9 E : Type*} {m\u03a9 : MeasurableSpace \u03a9} {mProd : MeasurableSpace (\u03b9 \u00d7 \u03a9)}\n [TopologicalSpace E] [Zero E] {a : \u03a9 \u2192 E} (ha : StronglyMeasurable[m\u03a9] a)\n {T : Set \u03b9} (hT : \u2200 \u2983A : Set \u03a9\u2984, MeasurableSet[m\u03a9] A \u2192 MeasurableSet[mProd] (T \u00d7\u02e2 A)) :\n StronglyMeasurable[mProd] (fun p : \u03b9 \u00d7 \u03a9 \u21a6 T.indicator (fun _ \u21a6 a p.2) p.1) := by\n classical\n let S : Set (\u03b9 \u00d7 \u03a9) := T \u00d7\u02e2 Set.univ\n have hS : MeasurableSet[mProd] S := hT MeasurableSet.univ\n have hproj : @Measurable S \u03a9 inferInstance m\u03a9 (fun p : S \u21a6 p.val.2) := by\n intro A hA\n refine \u27e8T \u00d7\u02e2 A, hT hA, ?_\u27e9\n ext p\n simp [S, p.property.1]\n simpa [S, Set.indicator_apply] using\n (ha.comp_measurable hproj).dite (stronglyMeasurable_const (b := (0 : E))) hS\n\nnamespace MeasureTheory\n\nopen Filter Set\n\n", "statement": "/-- A strongly measurable function is finitely strongly measurable if convergence of the\nconstant zero sequence to a finitely strongly measurable function implies convergence to it.\nThis transfers finite-support approximation without any separation assumption on the spaces. -/\ntheorem FinStronglyMeasurable.of_tendsto_const_zero {\u03b1 X G : Type*} [MeasurableSpace \u03b1]\n {\u03bc : Measure \u03b1} [TopologicalSpace X] [TopologicalSpace G] [Zero X] [Zero G]\n {u : \u03b1 \u2192 X} (hu : FinStronglyMeasurable u \u03bc) {v : \u03b1 \u2192 G}\n (hv : StronglyMeasurable v)\n (hzero : \u2200 t, Tendsto (fun _ : \u2115 \u21a6 (0 : X)) atTop (\ud835\udcdd (u t)) \u2192\n Tendsto (fun _ : \u2115 \u21a6 (0 : G)) atTop (\ud835\udcdd (v t))) :\n FinStronglyMeasurable v \u03bc ", "proof": " by\n classical\n -- Outside the union of the approximants\u2019 supports, zero converges to the input.\n let s := \u22c3 n, Function.support (hu.approx n)\n have hs : MeasurableSet s := .iUnion fun n \u21a6 (hu.approx n).measurableSet_support\n have h\u03bcs : SigmaFinite (\u03bc.restrict s) := by\n refine \u27e8\u27e8\u27e8fun n \u21a6 s\u1d9c \u222a Function.support (hu.approx n), fun _ \u21a6 trivial,\n fun n \u21a6 ?_, ?_\u27e9\u27e9\u27e9\n \u00b7 rw [Measure.restrict_apply' hs, Set.union_inter_distrib_right,\n Set.compl_inter_self s, Set.empty_union]\n exact (measure_mono Set.inter_subset_left).trans_lt (hu.fin_support_approx n)\n \u00b7 rw [\u2190 Set.union_iUnion]\n exact Set.compl_union_self s\n have hv' := (hv.indicator hs).finStronglyMeasurable_of_set_sigmaFinite hs\n (fun t ht \u21a6 Set.indicator_of_notMem ht _) h\u03bcs\n refine \u27e8fun n \u21a6 (hv'.approx n).restrict s, fun n \u21a6 ?_, fun t \u21a6 ?_\u27e9\n \u00b7 refine (measure_mono ?_).trans_lt (hv'.fin_support_approx n)\n intro t ht\n by_cases hts : t \u2208 s\n \u00b7 simpa [SimpleFunc.restrict_apply _ hs, hts, Function.mem_support] using ht\n \u00b7 simp [SimpleFunc.restrict_apply _ hs, hts, Function.mem_support] at ht\n \u00b7 by_cases hts : t \u2208 s\n \u00b7 simpa [SimpleFunc.restrict_apply _ hs, hts] using hv'.tendsto_approx t\n \u00b7 have hut : \u2200 n, hu.approx n t = 0 := by\n intro n\n by_contra hn\n exact hts (Set.mem_iUnion.2 \u27e8n, hn\u27e9)\n have ht := hzero t (by simpa only [hut] using hu.tendsto_approx t)\n simpa [SimpleFunc.restrict_apply _ hs, hts] using ht", "proof_lines": 28, "proof_length": 1259, "rev": "75c8aed5fea63047615a25a9763fd5b68a86e891", "heartbeats": 1162, "image": "lean-compression:tauceti-75c8aed5fe-a608030cfc", "split": "dev"} {"path": "TauCeti/Probability/Martingale/Basic.lean", "module": "TauCeti.Probability.Martingale.Basic", "theorem": "MeasureTheory.Martingale.const_min", "prefix": "/-\nCopyright (c) 2026 The Tau Ceti contributors. All rights reserved.\nReleased under Apache 2.0 license as described in the file LICENSE.\nAuthors: The Tau Ceti contributors\n-/\nmodule\n\npublic import Mathlib.Probability.Martingale.Basic\npublic import TauCeti.Probability.Process.Filtration.Comp\nimport Mathlib.MeasureTheory.Function.ConditionalExpectation.CondJensen\nimport Mathlib.MeasureTheory.Function.ConditionalExpectation.Real\nimport TauCeti.Probability.Moments.CondVar\n\n/-!\n# Martingale closure properties, division by a process, norms, and submartingale bounds\n\n`MeasureTheory.StronglyAdapted.martingale_iff_setIntegral_eq` characterizes martingales\namong adapted integrable processes by equality of set integrals at two dates. This is useful\nfor transporting martingales between measures without comparing conditional-expectation\nrepresentatives.\n\nClosure properties of martingales, including building blocks of the elementary stochastic\nintegral:\n\n* multiplying a martingale by a random scalar measurable at every time preserves the\n martingale property when the products are integrable, in particular for bounded scalars\n (`MeasureTheory.Martingale.smul_of_stronglyMeasurable`, `MeasureTheory.Martingale.bdd_smul`);\n* restricting a martingale to an event measurable at every time preserves the martingale\n property (`MeasureTheory.Martingale.indicator`);\n* a martingale `X` with values in a Banach space, frozen at a fixed date `w`, `t \u21a6 X (min w t)`,\n is a martingale (`MeasureTheory.Martingale.const_min`);\n* if a real martingale `Y` vanishes up to a date `r`, then multiplying it by a random variable\n known at time `r` gives a martingale, provided every product is integrable, as it is for a\n bounded multiplier (`MeasureTheory.Martingale.mul_left_of_eq_zero`).\n\nTogether they show that a position chosen at `r`, times the change of a martingale over\n`(r, r']`, is a martingale whenever this product is integrable at every time.\n\nThe following results need only a preordered time index. Sampling along a monotone time map\npreserves martingales, supermartingales, and submartingales with respect to the sampled\nfiltration (`MeasureTheory.Martingale.comp`, `MeasureTheory.Supermartingale.comp`, and\n`MeasureTheory.Submartingale.comp`). The norm of a Banach-valued\nmartingale is a submartingale (`MeasureTheory.Martingale.norm`), and raising an almost everywhere\nnonnegative real submartingale \u2014 in particular the norm of a Banach-valued martingale \u2014 to an\nintegrable power `p \u2265 1` gives a submartingale (`MeasureTheory.Submartingale.rpow` and\n`MeasureTheory.Martingale.norm_rpow`). A square-integrable real\nmartingale has conditional square equal to its current square plus the conditional square\nof its future increment (`MeasureTheory.Martingale.condExp_sq`), and the integral of its squared\nincrement on an earlier event equals the integral of the difference of its squares\n(`MeasureTheory.Martingale.setIntegral_sub_sq`). For a real submartingale,\nmultiplication by a nonnegative position known at an earlier date preserves the expectation\ninequality when both products are integrable (`MeasureTheory.Submartingale.integral_mul_le`).\nIn particular, positions need not be bounded. A predictable height times a later martingale\nincrement has mean zero when the product is integrable\n(`MeasureTheory.Martingale.integral_mul_sub_eq_zero`), with a Banach-valued scalar-action form\n`MeasureTheory.Martingale.integral_smul_sub_eq_zero`. Martingale values inherit deterministic\nnorm bounds and, for `p \u2265 1`, L\u1d56 integrability from later values\n(`MeasureTheory.Martingale.ae_norm_le_of_le`, `MeasureTheory.Martingale.memLp_of_le`).\nA martingale value vanishes a.e. at any date whose filtration trim is not sigma-finite\n(`MeasureTheory.Martingale.ae_eq_zero_of_not_sigmaFinite`).\nShorter increments with the same starting date inherit deterministic norm bounds\n(`MeasureTheory.Martingale.ae_norm_sub_le_of_le`), whereas increments over any contained interval\ninherit L\u1d56 integrability for `p \u2265 1` from the containing increment\n(`MeasureTheory.Martingale.memLp_sub_of_le`).\nNonnegative submartingale values inherit L\u1d56\nintegrability from later values for `p \u2265 1` (`MeasureTheory.Submartingale.memLp_of_le`).\n\nIf `V / N` is a martingale under `Q` for a real process `N`, then `V` is recovered from its value\nat a later date `j` as `V i = N i * Q[V j / N j | \u2131 i]` wherever `N i` does not vanish\n(`MeasureTheory.Martingale.ae_eq_mul_condExp_div`), so two such processes agreeing at `j` agree at\nevery earlier date (`MeasureTheory.Martingale.ae_eq_of_ae_eq_of_div`). In finance `N` is a\nnumeraire, the first statement is the conditional pricing formula and the second the law of one\nprice.\n-/\n\npublic section\n\nnoncomputable section\n\nopen Filter\nopen scoped ENNReal\n\nnamespace MeasureTheory\n\nsection Sampling\n\nvariable {\u03a9 \u03b9 \u03ba E : Type*} {m : MeasurableSpace \u03a9} {\u03bc : Measure \u03a9}\n [Preorder \u03b9] [Preorder \u03ba] [NormedAddCommGroup E] [NormedSpace \u211d E]\n {\u2131 : Filtration \u03b9 m} {X : \u03b9 \u2192 \u03a9 \u2192 E} {\u03c4 : \u03ba \u2192 \u03b9}\n\n/-- Sampling a martingale along a monotone map gives a martingale. -/\ntheorem Martingale.comp (hX : Martingale X \u2131 \u03bc) (h\u03c4 : Monotone \u03c4) :\n Martingale (fun n \u21a6 X (\u03c4 n)) (\u2131.comp h\u03c4) \u03bc := by\n refine \u27e8hX.stronglyAdapted.comp h\u03c4, fun i j hij \u21a6 ?_\u27e9\n simpa only [Filtration.comp_apply] using hX.condExp_ae_eq (h\u03c4 hij)\n\n/-- Sampling a supermartingale along a monotone map gives a supermartingale. -/\ntheorem Supermartingale.comp [LE E] (hX : Supermartingale X \u2131 \u03bc) (h\u03c4 : Monotone \u03c4) :\n Supermartingale (fun n \u21a6 X (\u03c4 n)) (\u2131.comp h\u03c4) \u03bc := by\n refine \u27e8hX.stronglyAdapted.comp h\u03c4, fun i j hij \u21a6 ?_, fun i \u21a6 hX.integrable (\u03c4 i)\u27e9\n simpa only [Filtration.comp_apply] using hX.condExp_ae_le (h\u03c4 hij)\n\n/-- Sampling a submartingale along a monotone map gives a submartingale. -/\ntheorem Submartingale.comp [LE E] (hX : Submartingale X \u2131 \u03bc) (h\u03c4 : Monotone \u03c4) :\n Submartingale (fun n \u21a6 X (\u03c4 n)) (\u2131.comp h\u03c4) \u03bc := by\n refine \u27e8hX.stronglyAdapted.comp h\u03c4, fun i j hij \u21a6 ?_, fun i \u21a6 hX.integrable (\u03c4 i)\u27e9\n simpa only [Filtration.comp_apply] using hX.ae_le_condExp (h\u03c4 hij)\n\nend Sampling\n\n/-- An adapted integrable process is a martingale exactly when its integrals on every\nevent known at an earlier date are unchanged between the two dates. -/\ntheorem StronglyAdapted.martingale_iff_setIntegral_eq {\u03a9 \u03b9 E : Type*}\n {m\u03a9 : MeasurableSpace \u03a9} {\u03bc : Measure \u03a9} [Preorder \u03b9]\n [NormedAddCommGroup E] [NormedSpace \u211d E] [CompleteSpace E]\n {\u2131 : Filtration \u03b9 m\u03a9} [SigmaFiniteFiltration \u03bc \u2131] {X : \u03b9 \u2192 \u03a9 \u2192 E}\n (hX : StronglyAdapted \u2131 X) (hint : \u2200 t, Integrable (X t) \u03bc) :\n Martingale X \u2131 \u03bc \u2194 \u2200 s t, s \u2264 t \u2192 \u2200 A, MeasurableSet[\u2131 s] A \u2192\n \u222b \u03c9 in A, X s \u03c9 \u2202\u03bc = \u222b \u03c9 in A, X t \u03c9 \u2202\u03bc := by\n refine \u27e8fun h s t hst A hA \u21a6 h.setIntegral_eq hst hA, fun h \u21a6 \u27e8hX, ?_\u27e9\u27e9\n intro s t hst\n exact (ae_eq_condExp_of_forall_setIntegral_eq (\u2131.le s) (hint t)\n (fun _ _ _ \u21a6 (hint s).integrableOn) (fun A hA _ \u21a6 h s t hst A hA)\n (hX s).aestronglyMeasurable).symm\n\nsection Div\n\nvariable {\u03a9 \u03b9 : Type*} {m\u03a9 : MeasurableSpace \u03a9} {P Q : Measure \u03a9} [Preorder \u03b9]\n {\u2131 : Filtration \u03b9 m\u03a9} {V V' N : \u03b9 \u2192 \u03a9 \u2192 \u211d} {i j : \u03b9}\n\n/-- If `V / N` is a martingale under a measure `Q` with `P \u226a Q`, then `V` is determined by its\nvalue at a later date `j`: at every date `i \u2264 j` at which `N` does not vanish,\n`V_i = N_i E_Q[V_j / N_j | \u2131_i]`, `P`-almost surely. For the wealth `V` of a strategy and a\nnumeraire `N`, this is the conditional pricing formula. -/\ntheorem Martingale.ae_eq_mul_condExp_div (hV : Martingale (V / N) \u2131 Q) (hPQ : P \u226a Q)\n (hN : \u2200\u1d50 \u03c9 \u2202P, N i \u03c9 \u2260 0) (hij : i \u2264 j) :\n V i =\u1d50[P] N i * Q[V j / N j | \u2131 i] := by\n filter_upwards [hPQ.ae_le (hV.condExp_ae_eq hij), hN] with \u03c9 h\u03c9 hN\u03c9\n simp only [Pi.mul_apply, Pi.div_apply] at h\u03c9 \u22a2\n rw [h\u03c9]\n field_simp\n\n/-- If `V / N` and `V' / N` are martingales under a measure `Q` equivalent to `P`, and `V` and\n`V'` agree at a date `j`, then they agree at every earlier date `i` at which `N` does not\nvanish. For the wealth of two strategies and a common numeraire `N`, this is the law of one\nprice: in particular the two strategies have the same initial cost. -/\ntheorem Martingale.ae_eq_of_ae_eq_of_div (hV : Martingale (V / N) \u2131 Q)\n (hV' : Martingale (V' / N) \u2131 Q) (hPQ : P \u226a Q) (hQP : Q \u226a P) (hN : \u2200\u1d50 \u03c9 \u2202P, N i \u03c9 \u2260 0)\n (hij : i \u2264 j) (hj : V j =\u1d50[P] V' j) : V i =\u1d50[P] V' i := by\n have hcond : Q[V j / N j | \u2131 i] =\u1d50[Q] Q[V' j / N j | \u2131 i] := by\n refine condExp_congr_ae ?_\n filter_upwards [hQP.ae_le hj] with \u03c9 h\u03c9\n simp only [Pi.div_apply, h\u03c9]\n filter_upwards [hV.ae_eq_mul_condExp_div hPQ hN hij, hV'.ae_eq_mul_condExp_div hPQ hN hij,\n hPQ.ae_le hcond] with \u03c9 h\u2081 h\u2082 h\u2083\n rw [h\u2081, h\u2082, Pi.mul_apply, Pi.mul_apply, h\u2083]\n\nend Div\n\n/-- Restricting a martingale to an event measurable at every time preserves the martingale\nproperty. In particular, for an index with a bottom element it suffices that the event be\nmeasurable at the bottom time. -/\ntheorem Martingale.indicator {\u03a9 \u03b9 E : Type*} {m : MeasurableSpace \u03a9} {\u03bc : Measure \u03a9}\n [Preorder \u03b9] [NormedAddCommGroup E] [NormedSpace \u211d E] [CompleteSpace E]\n {\u2131 : Filtration \u03b9 m} {X : \u03b9 \u2192 \u03a9 \u2192 E} (hX : Martingale X \u2131 \u03bc) {s : Set \u03a9}\n (hs : \u2200 t, MeasurableSet[\u2131 t] s) :\n Martingale (fun t \u21a6 s.indicator (X t)) \u2131 \u03bc := by\n refine \u27e8fun t \u21a6 (hX.stronglyMeasurable t).indicator (hs t), fun i j hij \u21a6 ?_\u27e9\n exact (condExp_indicator (hX.integrable j) (hs i)).trans (hX.condExp_ae_eq hij).indicator\n\nsection NormAndMultipliers\n\nvariable {\u03a9 \u03b9 E : Type*} {m\u03a9 : MeasurableSpace \u03a9} {\u03bc : Measure \u03a9} [Preorder \u03b9]\n [NormedAddCommGroup E] [NormedSpace \u211d E] [CompleteSpace E]\n {\u2131 : Filtration \u03b9 m\u03a9} {X : \u03b9 \u2192 \u03a9 \u2192 E} {Y : \u03b9 \u2192 \u03a9 \u2192 \u211d}\n\n/-- Multiplication by a random real scalar measurable at every time preserves a martingale\nwhenever all the products are integrable. No sigma-finiteness assumption is needed. -/\ntheorem Martingale.smul_of_stronglyMeasurable (hX : Martingale X \u2131 \u03bc) {c : \u03a9 \u2192 \u211d}\n (hc : \u2200 t, StronglyMeasurable[\u2131 t] c)\n (hint : \u2200 t, Integrable (fun \u03c9 \u21a6 c \u03c9 \u2022 X t \u03c9) \u03bc) :\n Martingale (fun t \u03c9 \u21a6 c \u03c9 \u2022 X t \u03c9) \u2131 \u03bc := by\n refine \u27e8fun t \u21a6 (hc t).smul (hX.stronglyMeasurable t), fun s t hst \u21a6 ?_\u27e9\n exact (condExp_smul_of_aestronglyMeasurable_left (hc s).aestronglyMeasurable\n (hint t) (hX.integrable t)).trans\n ((hX.condExp_ae_eq hst).mono fun \u03c9 h\u03c9 \u21a6 by simp only [Pi.smul_apply', h\u03c9])\n\n/-- An almost surely bounded random real scalar measurable at every time preserves\nBanach-valued martingales. -/\ntheorem Martingale.bdd_smul (hX : Martingale X \u2131 \u03bc) {c : \u03a9 \u2192 \u211d}\n (hc : \u2200 t, StronglyMeasurable[\u2131 t] c) (C : \u211d) (hbound : \u2200\u1d50 \u03c9 \u2202\u03bc, \u2016c \u03c9\u2016 \u2264 C) :\n Martingale (fun t \u03c9 \u21a6 c \u03c9 \u2022 X t \u03c9) \u2131 \u03bc := by\n apply hX.smul_of_stronglyMeasurable hc\n intro t\n exact (hX.integrable t).bdd_smul C ((hc t).mono (\u2131.le t)).aestronglyMeasurable hbound\n\n/-- The norm of a Banach-valued martingale is a submartingale. -/\ntheorem Martingale.norm (hX : Martingale X \u2131 \u03bc) :\n Submartingale (fun t \u03c9 => \u2016X t \u03c9\u2016) \u2131 \u03bc := by\n refine \u27e8fun t => (hX.stronglyAdapted t).norm, fun s t hst => ?_,\n fun t => (hX.integrable t).norm\u27e9\n filter_upwards [hX.condExp_ae_eq hst, norm_condExp_le (m := \u2131 s) (X t)] with \u03c9 he hle\n simpa only [he] using hle\n\n/-- A martingale value inherits L\u1d56 integrability from a later value for `p \u2265 1`. -/\ntheorem Martingale.memLp_of_le (hX : Martingale X \u2131 \u03bc) {i j : \u03b9} (hij : i \u2264 j)\n {p : \u211d\u22650\u221e} (hp : 1 \u2264 p) (hj : MemLp (X j) p \u03bc) : MemLp (X i) p \u03bc :=\n (hj.condExp (m := \u2131 i) hp).ae_eq (hX.condExp_ae_eq hij)\n\nomit [CompleteSpace E] in\n/-- A martingale value vanishes almost everywhere if the measure trimmed to the filtration at\nthat date is not sigma-finite. -/\ntheorem Martingale.ae_eq_zero_of_not_sigmaFinite (hX : Martingale X \u2131 \u03bc) {i : \u03b9}\n (hi : \u00acSigmaFinite (\u03bc.trim (\u2131.le i))) : X i =\u1d50[\u03bc] 0 := by\n simpa only [condExp_of_not_sigmaFinite (\u2131.le i) hi] using\n (hX.condExp_ae_eq (i := i) le_rfl).symm\n\n/-- Conditioning a martingale increment on an intermediate date keeps its past part. -/\ntheorem Martingale.condExp_sub_ae_eq (hX : Martingale X \u2131 \u03bc) {s t u : \u03b9}\n (hst : s \u2264 t) (htu : t \u2264 u) : \u03bc[X u - X s | \u2131 t] =\u1d50[\u03bc] X t - X s := by\n have hs : \u03bc[X s | \u2131 t] =\u1d50[\u03bc] X s := by\n by_cases ht : SigmaFinite (\u03bc.trim (\u2131.le t))\n \u00b7 exact EventuallyEq.of_eq (condExp_of_stronglyMeasurable (\u2131.le t)\n ((hX.stronglyMeasurable s).mono (\u2131.mono hst)) (hX.integrable s))\n \u00b7 have hs : \u00acSigmaFinite (\u03bc.trim (\u2131.le s)) := fun hs \u21a6\n ht (sigmaFiniteTrim_mono (\u2131.le t) (\u2131.mono hst))\n rw [condExp_of_not_sigmaFinite (\u2131.le t) ht]\n exact (hX.ae_eq_zero_of_not_sigmaFinite hs).symm\n exact (condExp_sub (hX.integrable u) (hX.integrable s) _).trans\n ((hX.condExp_ae_eq htu).sub hs)\n\n/-- A martingale increment inherits L\u1d56 integrability from an increment over a containing\ninterval, for `p \u2265 1`. The initial value need only be integrable. -/\ntheorem Martingale.memLp_sub_of_le (hX : Martingale X \u2131 \u03bc) {s t u v : \u03b9}\n (hst : s \u2264 t) (htu : t \u2264 u) (huv : u \u2264 v) {p : \u211d\u22650\u221e} (hp : 1 \u2264 p)\n (hv : MemLp (X v - X s) p \u03bc) : MemLp (X u - X t) p \u03bc := by\n have hu := (hv.condExp (m := \u2131 u) hp).ae_eq (hX.condExp_sub_ae_eq (hst.trans htu) huv)\n have ht := (hv.condExp (m := \u2131 t) hp).ae_eq (hX.condExp_sub_ae_eq hst (htu.trans huv))\n simpa only [Pi.sub_def, sub_sub_sub_cancel_right] using hu.sub ht\n\n/-- On a nondecreasing finite grid, L\u1d56 integrability of the total martingale increment\nimplies L\u1d56 integrability of each grid increment, for `p \u2265 1`. No L\u1d56 assumption on the\ninitial value is needed. -/\ntheorem Martingale.memLp_sub_of_monotoneOn (hX : Martingale X \u2131 \u03bc) {\u03c4 : \u2115 \u2192 \u03b9} {n : \u2115}\n (h\u03c4 : MonotoneOn \u03c4 (Set.Iic n)) {p : \u211d\u22650\u221e} (hp : 1 \u2264 p)\n (hn : MemLp (X (\u03c4 n) - X (\u03c4 0)) p \u03bc) {i : \u2115} (hi : i < n) :\n MemLp (X (\u03c4 (i + 1)) - X (\u03c4 i)) p \u03bc :=\n hX.memLp_sub_of_le (h\u03c4 (by simp) hi.le (Nat.zero_le i))\n (h\u03c4 hi.le hi (Nat.le_succ i)) (h\u03c4 hi (by simp) hi) hp hn\n\n/-- Raising an almost everywhere nonnegative real submartingale to a power `p \u2265 1` gives a\nsubmartingale whenever the powered values are integrable. No sigma-finiteness assumption on the\nfiltration trims is required. -/\ntheorem Submartingale.rpow (hY : Submartingale Y \u2131 \u03bc) (hpos : \u2200 t, 0 \u2264\u1d50[\u03bc] Y t) {p : \u211d}\n (hp : 1 \u2264 p) (hint : \u2200 t, Integrable (fun \u03c9 \u21a6 Y t \u03c9 ^ p) \u03bc) :\n Submartingale (fun t \u03c9 \u21a6 Y t \u03c9 ^ p) \u2131 \u03bc := by\n have hp0 : 0 < p := zero_lt_one.trans_le hp\n refine \u27e8fun t \u21a6 (Real.continuous_rpow_const hp0.le).comp_stronglyMeasurable\n (hY.stronglyAdapted t), fun i j hij \u21a6 ?_, hint\u27e9\n by_cases h\u03bc : SigmaFinite (\u03bc.trim (\u2131.le i))\n \u00b7 have hl :=\n (Real.continuous_rpow_const hp0.le).lowerSemicontinuous.lowerSemicontinuousOn (Set.Ici 0)\n have hjensen := (convexOn_rpow hp).map_condExp_le (\u2131.le i) hl (hpos j) isClosed_Ici\n (hY.integrable j) (hint j)\n filter_upwards [hpos i, hY.ae_le_condExp hij, hjensen] with \u03c9 hpos_i hle hjen\n exact (Real.rpow_le_rpow hpos_i hle hp0.le).trans hjen\n \u00b7 have hcond0 : \u03bc[Y j | \u2131 i] = 0 := condExp_of_not_sigmaFinite (\u2131.le i) h\u03bc\n have hcondp0 : \u03bc[fun \u03c9 \u21a6 Y j \u03c9 ^ p | \u2131 i] = 0 := condExp_of_not_sigmaFinite (\u2131.le i) h\u03bc\n filter_upwards [hpos i, hY.ae_le_condExp hij] with \u03c9 hpos_i hle\n have hYi0 : Y i \u03c9 = 0 := le_antisymm (by simpa [hcond0] using hle) hpos_i\n simp [hYi0, hcondp0, Real.zero_rpow hp0.ne']\n\n/-- For `p \u2265 1`, the `p`-th power of the norm of a Banach-valued martingale is a submartingale\nwhenever it is integrable at each date. -/\ntheorem Martingale.norm_rpow (hX : Martingale X \u2131 \u03bc) {p : \u211d} (hp : 1 \u2264 p)\n (hint : \u2200 t, Integrable (fun \u03c9 \u21a6 \u2016X t \u03c9\u2016 ^ p) \u03bc) :\n Submartingale (fun t \u03c9 \u21a6 \u2016X t \u03c9\u2016 ^ p) \u2131 \u03bc :=\n hX.norm.rpow (fun _ \u21a6 .of_forall fun _ \u21a6 norm_nonneg _) hp hint\n\nopen scoped ProbabilityTheory in\n/-- The conditional square of a square-integrable real martingale value is\nthe current square plus the conditional square of the future increment. -/\ntheorem Martingale.condExp_sq (hY : Martingale Y \u2131 \u03bc) {i j : \u03b9}\n (hij : i \u2264 j) (hj : MemLp (Y j) 2 \u03bc) :\n \u03bc[fun \u03c9 \u21a6 Y j \u03c9 ^ 2 | \u2131 i] =\u1d50[\u03bc]\n fun \u03c9 \u21a6 Y i \u03c9 ^ 2 + \u03bc[fun \u03c9 \u21a6 (Y j \u03c9 - Y i \u03c9) ^ 2 | \u2131 i] \u03c9 := by\n have hc := hY.condExp_ae_eq hij\n -- The conditional variance of `Y j` given `\u2131 i`, centred at `\u03bc[Y j | \u2131 i] = Y i`.\n have hvar : Var[Y j; \u03bc | \u2131 i] =\u1d50[\u03bc] \u03bc[fun \u03c9 \u21a6 (Y j \u03c9 - Y i \u03c9) ^ 2 | \u2131 i] :=\n ProbabilityTheory.condVar_ae_eq_condExp_sub_sq_of_condExp_ae_eq hc\n filter_upwards [ProbabilityTheory.condVar_ae_eq_condExp_sq_sub_sq_condExp' (\u2131.le i) hj, hvar, hc]\n with \u03c9 h\u2081 h\u2082 h\u2083\n simp only [Pi.sub_apply, Pi.pow_apply] at h\u2081\n rw [Pi.pow_def] at h\u2081\n rw [\u2190 h\u2082, h\u2081, h\u2083]\n ring\n\n/-- On any event known at time `i`, the integral of the squared increment `(Y j - Y i) ^ 2` of\na square-integrable real martingale equals the integral of the difference of squares\n`Y j ^ 2 - Y i ^ 2`. -/\ntheorem Martingale.setIntegral_sub_sq (hY : Martingale Y \u2131 \u03bc) {i j : \u03b9} (hij : i \u2264 j)\n (hj : MemLp (Y j) 2 \u03bc) {A : Set \u03a9} (hA : MeasurableSet[\u2131 i] A) :\n \u222b \u03c9 in A, (Y j \u03c9 - Y i \u03c9) ^ 2 \u2202\u03bc = \u222b \u03c9 in A, (Y j \u03c9 ^ 2 - Y i \u03c9 ^ 2) \u2202\u03bc := by\n by_cases h\u03bc : SigmaFinite (\u03bc.trim (\u2131.le i))\n \u00b7 have hi : MemLp (Y i) 2 \u03bc :=\n (hj.condExp (m := \u2131 i) one_le_two).ae_eq (hY.condExp_ae_eq hij)\n have hj2 : Integrable (fun \u03c9 \u21a6 Y j \u03c9 ^ 2) \u03bc := hj.integrable_sq\n have hi2 : Integrable (fun \u03c9 \u21a6 Y i \u03c9 ^ 2) \u03bc := hi.integrable_sq\n have hdiff2 : Integrable (fun \u03c9 \u21a6 (Y j \u03c9 - Y i \u03c9) ^ 2) \u03bc := (hj.sub hi).integrable_sq\n have hint := setIntegral_congr_ae (\u2131.le i A hA)\n ((hY.condExp_sq hij hj).mono fun _ h\u03c9 _ \u21a6 h\u03c9)\n rw [setIntegral_condExp (\u2131.le i) hj2 hA,\n integral_add hi2.integrableOn integrable_condExp.integrableOn,\n setIntegral_condExp (\u2131.le i) hdiff2 hA] at hint\n rw [integral_sub hj2.integrableOn hi2.integrableOn, hint, add_sub_cancel_left]\n \u00b7 have hc := hY.condExp_ae_eq hij\n rw [condExp_of_not_sigmaFinite (\u2131.le i) h\u03bc] at hc\n have hcongr : \u2200 g : \u03a9 \u2192 \u211d, (\u2200 \u03c9, Y i \u03c9 = 0 \u2192 g \u03c9 = Y j \u03c9 ^ 2) \u2192\n \u222b \u03c9 in A, g \u03c9 \u2202\u03bc = \u222b \u03c9 in A, Y j \u03c9 ^ 2 \u2202\u03bc := fun g hg \u21a6\n setIntegral_congr_ae (\u2131.le i A hA) (hc.symm.mono fun \u03c9 h\u03c9 _ \u21a6 hg \u03c9 (by simpa using h\u03c9))\n exact (hcongr _ fun \u03c9 h\u03c9 \u21a6 by simp [h\u03c9]).trans\n (hcongr _ fun \u03c9 h\u03c9 \u21a6 by simp [h\u03c9]).symm\n\n/-- A nonnegative position known at time `i` preserves a submartingale's expectation inequality\nbetween `i` and `j`, provided its products with both values are integrable. -/\ntheorem Submartingale.integral_mul_le [SigmaFiniteFiltration \u03bc \u2131]\n (hY : Submartingale Y \u2131 \u03bc) {i j : \u03b9} (hij : i \u2264 j) {a : \u03a9 \u2192 \u211d}\n (ha : StronglyMeasurable[\u2131 i] a) (hpos : 0 \u2264\u1d50[\u03bc] a)\n (hi : Integrable (a * Y i) \u03bc) (hj : Integrable (a * Y j) \u03bc) :\n \u222b \u03c9, a \u03c9 * Y i \u03c9 \u2202\u03bc \u2264 \u222b \u03c9, a \u03c9 * Y j \u03c9 \u2202\u03bc := by\n have he := condExp_mul_of_stronglyMeasurable_left ha hj (hY.integrable j)\n calc\n _ \u2264 \u222b \u03c9, (a * \u03bc[Y j | \u2131 i]) \u03c9 \u2202\u03bc := by\n apply integral_mono_ae hi (integrable_condExp.congr he)\n filter_upwards [hpos, hY.ae_le_condExp hij] with \u03c9 hp hle\n exact mul_le_mul_of_nonneg_left hle hp\n _ = \u222b \u03c9, \u03bc[a * Y j | \u2131 i] \u03c9 \u2202\u03bc := integral_congr_ae he.symm\n _ = _ := integral_condExp (\u2131.le i)\n\nomit [CompleteSpace E] in\n/-- The integral of a predictable height times a later martingale increment is zero.\nIn the nonintegrable case or for an incomplete codomain, the integral is zero by convention. -/\ntheorem Martingale.integral_smul_sub_eq_zero\n (hX : Martingale X \u2131 \u03bc) {s t : \u03b9} [SigmaFinite (\u03bc.trim (\u2131.le s))] (hst : s \u2264 t)\n {\u03be : \u03a9 \u2192 \u211d} (h\u03be : AEStronglyMeasurable[\u2131 s] \u03be \u03bc) :\n \u222b \u03c9, \u03be \u03c9 \u2022 (X t \u03c9 - X s \u03c9) \u2202\u03bc = 0 := by\n by_cases hE : CompleteSpace E\n swap\n \u00b7 exact integral_of_not_completeSpace hE\n by_cases hint : Integrable (\u03be \u2022 (X t - X s)) \u03bc\n swap\n \u00b7 simpa only [Pi.smul_def', Pi.sub_def] using integral_undef hint\n have hzero : \u03bc[X t - X s | \u2131 s] =\u1d50[\u03bc] 0 := by\n simpa only [sub_self] using hX.condExp_sub_ae_eq le_rfl hst\n have hpull := condExp_smul_of_aestronglyMeasurable_left h\u03be hint\n ((hX.integrable t).sub (hX.integrable s))\n have heq : \u03bc[\u03be \u2022 (X t - X s) | \u2131 s] =\u1d50[\u03bc] 0 := by\n filter_upwards [hpull, hzero] with \u03c9 hp hz\n simpa [hz] using hp\n simpa only [Pi.smul_apply', Pi.sub_apply, Pi.zero_apply, integral_zero] using\n (integral_condExp (\u2131.le s) (f := \u03be \u2022 (X t - X s))).symm.trans (integral_congr_ae heq)\n\n/-- The integral of a predictable real height times a later real martingale increment is zero.\nIn the nonintegrable case, the integral is zero by convention. -/\ntheorem Martingale.integral_mul_sub_eq_zero\n (hM : Martingale Y \u2131 \u03bc) {s t : \u03b9} [SigmaFinite (\u03bc.trim (\u2131.le s))] (hst : s \u2264 t)\n {\u03be : \u03a9 \u2192 \u211d} (h\u03be : AEStronglyMeasurable[\u2131 s] \u03be \u03bc) :\n \u222b \u03c9, \u03be \u03c9 * (Y t \u03c9 - Y s \u03c9) \u2202\u03bc = 0 := by\n simpa only [smul_eq_mul] using hM.integral_smul_sub_eq_zero hst h\u03be\n\n/-- A deterministic almost-sure norm bound on a martingale at a later date also bounds\nits value at every earlier date. -/\ntheorem Martingale.ae_norm_le_of_le (hX : Martingale X \u2131 \u03bc) {i j : \u03b9} (hij : i \u2264 j)\n {C : \u211d} (hb : \u2200\u1d50 \u03c9 \u2202\u03bc, \u2016X j \u03c9\u2016 \u2264 C) : \u2200\u1d50 \u03c9 \u2202\u03bc, \u2016X i \u03c9\u2016 \u2264 C := by\n filter_upwards [ae_bdd_norm_condExp_of_ae_bdd_norm (m := \u2131 i) hb,\n hX.condExp_ae_eq hij] with \u03c9 hb he\n simpa only [he] using hb\n\n/-- A deterministic almost-sure norm bound on a martingale increment also bounds shorter\nincrements with the same starting date. -/\ntheorem Martingale.ae_norm_sub_le_of_le (hX : Martingale X \u2131 \u03bc) {s t u : \u03b9}\n (hst : s \u2264 t) (htu : t \u2264 u) {C : \u211d} (hb : \u2200\u1d50 \u03c9 \u2202\u03bc, \u2016X u \u03c9 - X s \u03c9\u2016 \u2264 C) :\n \u2200\u1d50 \u03c9 \u2202\u03bc, \u2016X t \u03c9 - X s \u03c9\u2016 \u2264 C := by\n filter_upwards [ae_bdd_norm_condExp_of_ae_bdd_norm (m := \u2131 t) hb,\n hX.condExp_sub_ae_eq hst htu] with \u03c9 hb he\n exact (congrArg (fun x : E \u21a6 \u2016x\u2016) he).symm.le.trans hb\n\n/-- A nonnegative submartingale value inherits L\u1d56 integrability from a later value,\nfor every `p \u2265 1`. Only the earlier value needs to be nonnegative. -/\ntheorem Submartingale.memLp_of_le (hY : Submartingale Y \u2131 \u03bc) {i j : \u03b9} (hij : i \u2264 j)\n (hpos : 0 \u2264\u1d50[\u03bc] Y i) {p : \u211d\u22650\u221e} (hp : 1 \u2264 p) (hj : MemLp (Y j) p \u03bc) :\n MemLp (Y i) p \u03bc := by\n apply (MemLp.condExp (m := \u2131 i) hp hj).mono'\n ((hY.stronglyAdapted i).mono (\u2131.le i)).aestronglyMeasurable\n filter_upwards [hpos, hY.ae_le_condExp hij] with \u03c9 hpos\u03c9 h\u03c9\n simpa only [Real.norm_eq_abs, abs_of_nonneg hpos\u03c9] using h\u03c9\n\nend NormAndMultipliers\n\nvariable {\u03a9 \u03b9 E : Type*} {m\u03a9 : MeasurableSpace \u03a9} {\u03bc : Measure \u03a9} [LinearOrder \u03b9]\n [NormedAddCommGroup E] [NormedSpace \u211d E] [CompleteSpace E]\n {\u2131 : Filtration \u03b9 m\u03a9} {X : \u03b9 \u2192 \u03a9 \u2192 E} {Y : \u03b9 \u2192 \u03a9 \u2192 \u211d}\n\n", "statement": "omit [CompleteSpace E] in\n/-- A martingale frozen at a fixed date `w`, `t \u21a6 X (min w t)`, is a martingale. -/\ntheorem Martingale.const_min [SigmaFiniteFiltration \u03bc \u2131] (hX : Martingale X \u2131 \u03bc) (w : \u03b9) :\n Martingale (fun t \u21a6 X (min w t)) \u2131 \u03bc ", "proof": " by\n -- `X w` is integrable: otherwise its conditional expectation would vanish, forcing `X w = 0`\n have hint : Integrable (X w) \u03bc := by\n by_contra h\n have h0 := hX.condExp_ae_eq (le_refl w)\n rw [condExp_of_not_integrable h] at h0\n exact h ((integrable_zero _ _ _).congr h0)\n refine \u27e8fun t \u21a6 hX.stronglyAdapted.stronglyMeasurable_le (min_le_right _ _),\n fun s t hst \u21a6 ?_\u27e9\n beta_reduce\n rcases le_or_gt w s with hws | hsw\n \u00b7 rw [min_eq_left (hws.trans hst), min_eq_left hws,\n condExp_of_stronglyMeasurable (\u2131.le s) ((hX.stronglyAdapted w).mono (\u2131.mono hws))\n hint]\n \u00b7 rw [min_eq_right hsw.le]\n exact hX.condExp_ae_eq (le_min hsw.le hst)", "proof_lines": 15, "proof_length": 525, "rev": "75c8aed5fea63047615a25a9763fd5b68a86e891", "heartbeats": 524, "image": "lean-compression:tauceti-75c8aed5fe-a608030cfc", "split": "dev"} {"path": "TauCeti/LinearAlgebra/End/CyclicNorm.lean", "module": "TauCeti.LinearAlgebra.End.CyclicNorm", "theorem": "Module.End.isCompl_ker_range_one_sub_of_pow_eq_one", "prefix": "/-\nCopyright (c) 2026 The Tau Ceti contributors. All rights reserved.\nReleased under Apache 2.0 license as described in the file LICENSE.\nAuthors: The Tau Ceti contributors\n-/\nmodule\n\npublic import TauCeti.LinearAlgebra.End.CompositionRange\nimport Mathlib.Algebra.Ring.GeomSum\n\n/-!\n# Cyclic norms of endomorphisms\n\nFor an endomorphism `f` satisfying `f ^ n = 1` with `n` invertible, the kernel of the\ncyclic norm `\u2211 j < n, f ^ j` is the image of `1 - f`, and the latter splits off from\nthe fixed submodule. For a commuting family the simultaneous norm kernels are thus\nexactly the image of the product of the differences.\n\nThis is the cyclic averaging argument used to identify ramified vectors in\n`New.Data.ramifiedSourceForms_eq_range` in lsernau/grh-lean, revision `72fead1`,\n`grh/src/New/UpperBound/Size/ShortColumns.lean`.\n-/\n\npublic section\n\nopen LinearMap\n\nnamespace Module.End\n\n/-- When `f ^ n = 1` and `n` is invertible in the coefficient ring, the image of\n`1 - f` is the kernel of the cyclic norm `1 + f + \u22ef + f ^ (n - 1)`. -/\ntheorem range_one_sub_eq_ker_geom_sum {R M : Type*} [Ring R] [AddCommGroup M]\n [Module R M] (f : End R M) {n : \u2115} (hn : IsUnit (n : R)) (hf : f ^ n = 1) :\n range (1 - f) = ker (\u2211 j \u2208 Finset.range n, f ^ j) := by\n refine le_antisymm ?_ ?_\n \u00b7 have h := geom_sum_mul_neg f n\n rw [hf, sub_self] at h\n exact range_le_ker_iff.mpr h\n \u00b7 intro x hx\n have hsum : \u2211 j \u2208 Finset.range n, (x - (f ^ j) x) \u2208 range (1 - f) := by\n apply Submodule.sum_mem\n intro j _\n exact mem_range.mpr \u27e8(\u2211 i \u2208 Finset.range j, f ^ i) x, by\n simpa only [mul_apply_eq_comp, LinearMap.sub_apply, one_apply_eq_self] using\n LinearMap.congr_fun (mul_neg_geom_sum f j) x\u27e9\n rw [Finset.sum_sub_distrib, Finset.sum_const, Finset.card_range,\n \u2190 LinearMap.sum_apply, mem_ker.mp hx, sub_zero, \u2190 Nat.cast_smul_eq_nsmul R] at hsum\n exact ((range (1 - f)).smul_mem_iff_of_isUnit hn).mp hsum\n\n", "statement": "/-- The fixed submodule of an endomorphism of invertible period is complementary to\nthe image of its difference from the identity. -/\ntheorem isCompl_ker_range_one_sub_of_pow_eq_one {R M : Type*} [Ring R] [AddCommGroup M]\n [Module R M] (f : End R M) {n : \u2115} (hn : IsUnit (n : R)) (hf : f ^ n = 1) :\n IsCompl (ker (1 - f)) (range (1 - f)) ", "proof": " by\n let N : End R M := \u2211 j \u2208 Finset.range n, f ^ j\n have hr : range (1 - f) = ker N := f.range_one_sub_eq_ker_geom_sum hn hf\n have hfixed (x : M) (hx : x \u2208 ker (1 - f)) : N x = (n : R) \u2022 x := by\n have hfx : f x = x := (sub_eq_zero.mp (by simpa using mem_ker.mp hx)).symm\n have hpow (j : \u2115) : (f ^ j) x = x := by\n induction j with\n | zero => simp\n | succ j ih => rw [pow_succ', mul_apply_eq_comp, ih, hfx]\n simp [N, LinearMap.sum_apply, hpow, Nat.cast_smul_eq_nsmul]\n refine \u27e8disjoint_iff_inf_le.mpr (fun x hx \u21a6 ?_), codisjoint_iff_le_sup.mpr ?_\u27e9\n \u00b7 obtain \u27e8hx, hx'\u27e9 := Submodule.mem_inf.mp hx\n rw [hr, mem_ker, hfixed x hx] at hx'\n exact ((\u22a5 : Submodule R M).smul_mem_iff_of_isUnit hn).mp (by simpa using hx')\n \u00b7 intro x _\n obtain \u27e8u, hu\u27e9 := hn\n let y : M := (\u2191u\u207b\u00b9 : R) \u2022 N x\n have hNy : N x \u2208 ker (1 - f) := by\n apply mem_ker.mpr\n simpa only [mul_apply_eq_comp, hf, sub_self, LinearMap.zero_apply] using\n LinearMap.congr_fun (mul_neg_geom_sum f n) x\n have hy : y \u2208 ker (1 - f) := (ker (1 - f)).smul_mem _ hNy\n have hy' : x - y \u2208 range (1 - f) := by\n rw [hr, mem_ker, map_sub, hfixed y hy, sub_eq_zero]\n simp [y, \u2190 hu, smul_smul]\n exact Submodule.mem_sup.mpr \u27e8y, hy, x - y, hy', add_sub_cancel _ _\u27e9", "proof_lines": 25, "proof_length": 1173, "rev": "75c8aed5fea63047615a25a9763fd5b68a86e891", "heartbeats": 2367, "image": "lean-compression:tauceti-75c8aed5fe-a608030cfc", "split": "dev"} {"path": "TauCeti/RingTheory/Flat/Jacobson.lean", "module": "TauCeti.RingTheory.Flat.Jacobson", "theorem": "Module.FaithfullyFlat.of_faithfullyFlat_quotient_smul_top", "prefix": "/-\nCopyright (c) 2026 The Tau Ceti contributors. All rights reserved.\nReleased under Apache 2.0 license as described in the file LICENSE.\nAuthors: The Tau Ceti contributors\n-/\nmodule\n\npublic import Mathlib.Algebra.Module.Torsion.Basic\npublic import Mathlib.RingTheory.Flat.FaithfullyFlat.Basic\npublic import Mathlib.RingTheory.Jacobson.Ideal\n\n/-!\n# Faithful flatness through a quotient by a Jacobson ideal\n\nA flat `A`-algebra `B`, not necessarily commutative, is faithfully flat as soon as, for some\nideal `J` contained in the Jacobson radical of `A`, the quotient map `A \u2192 A \u29f8 J` factors through\n`B`. Every maximal ideal `\ud835\udd2a` of `A` contains `J`, so its image in `A \u29f8 J` is proper; hence `\ud835\udd2a B`\nis proper as well.\n\nThe criterion needs no finiteness or locality hypothesis. It applies, for instance, to the\nhenselization of a pair `(A, J)` with `J` in the Jacobson radical, and to an adic completion of\n`A` along such an ideal once that completion is known to be flat. In both cases the factorization\nthrough `A \u29f8 J` comes from the identification of the closed fibre.\n\nThe same argument works for modules with the factorization replaced by faithful flatness of the\nreduction: a flat `A`-module `M` is faithfully flat as soon as `M \u29f8 J M` is faithfully flat over\n`A \u29f8 J`. If `\ud835\udd2a M = M` for a maximal ideal `\ud835\udd2a \u2287 J`, then the maximal ideal `\ud835\udd2a \u29f8 J` of `A \u29f8 J`\nwould satisfy the same equation on `M \u29f8 J M`. Together with the infinitesimal local flatness\ncriterion (`Module.Flat.of_forall_flat_quotient_pow_of_isHausdorff`), this gives faithful flatness\nof a module from faithful flatness of its reduction, as in the proof of Bosch\u2013L\u00fctkebohmert's\nflatness criterion for formal schemes.\n\n## Main results\n\n* `Module.FaithfullyFlat.of_le_jacobson_of_algHom`: the criterion for algebras above.\n* `Module.FaithfullyFlat.of_faithfullyFlat_quotient_smul_top`: the criterion for modules.\n\n## References\n\n* S. Bosch, W. L\u00fctkebohmert, *Formal and rigid geometry I. Rigid spaces*, Math. Ann. 295 (1993),\n \u00a71, Lemma 1.6.\n-/\n\npublic section\n\nnamespace Module.FaithfullyFlat\n\nvariable {A B : Type*} [CommRing A] [Ring B] [Algebra A B]\n\n/-- A flat `A`-algebra `B` is faithfully flat if, for an ideal `J` in the Jacobson radical of\n`A`, the quotient map `A \u2192 A \u29f8 J` factors through an `A`-algebra map `B \u2192 A \u29f8 J`. -/\ntheorem of_le_jacobson_of_algHom [Module.Flat A B] {J : Ideal A}\n (hJ : J \u2264 Ring.jacobson A) (f : B \u2192\u2090[A] A \u29f8 J) : Module.FaithfullyFlat A B := by\n refine \u27e8fun m hm h \u21a6 hm.ne_top ?_\u27e9\n have hJm : J \u2264 m := hJ.trans (Ring.jacobson_le_of_isMaximal m)\n have hf : Function.Surjective f := fun y \u21a6 by\n obtain \u27e8a, rfl\u27e9 := Ideal.Quotient.mk_surjective y\n exact \u27e8algebraMap A B a, by rw [f.commutes, Ideal.Quotient.algebraMap_eq]\u27e9\n -- The image of `m` in `A \u29f8 J` is the image of `m B` under `f`, hence the unit ideal.\n have hmap : m.map (Ideal.Quotient.mk J) = \u22a4 := by\n have := congrArg (Submodule.map f.toLinearMap) h\n rwa [Submodule.map_smul'', Submodule.map_top, LinearMap.range_eq_top.mpr hf,\n Ideal.smul_top_eq_map, Submodule.restrictScalars_eq_top_iff,\n Ideal.Quotient.algebraMap_eq] at this\n have := Ideal.comap_map_of_surjective' (Ideal.Quotient.mk J) Ideal.Quotient.mk_surjective m\n rwa [hmap, Ideal.comap_top, Ideal.mk_ker, sup_eq_left.mpr hJm, eq_comm] at this\n\nvariable {M : Type*} [AddCommGroup M] [Module A M]\n\n", "statement": "/-- A flat `A`-module `M` is faithfully flat if, for an ideal `J` in the Jacobson radical of `A`,\nthe reduction `M \u29f8 J M` is faithfully flat over `A \u29f8 J`. -/\ntheorem of_faithfullyFlat_quotient_smul_top [Module.Flat A M] {J : Ideal A}\n (hJ : J \u2264 (\u22a5 : Ideal A).jacobson)\n [Module.FaithfullyFlat (A \u29f8 J) (M \u29f8 J \u2022 (\u22a4 : Submodule A M))] :\n Module.FaithfullyFlat A M ", "proof": " by\n refine \u27e8fun m hm h \u21a6 ?_\u27e9\n have hJm : J \u2264 m := hJ.trans (sInf_le \u27e8bot_le, hm\u27e9)\n -- The image of `m` in `A \u29f8 J` is maximal, and it would act surjectively on `M \u29f8 J M`.\n have : (m.map (Ideal.Quotient.mk J)).IsMaximal :=\n hm.map_of_surjective_of_ker_le Ideal.Quotient.mk_surjective (by rwa [Ideal.mk_ker])\n refine Module.FaithfullyFlat.submodule_ne_top (M := M \u29f8 J \u2022 (\u22a4 : Submodule A M)) this\n (eq_top_iff.mpr fun x _ \u21a6 ?_)\n obtain \u27e8x, rfl\u27e9 := Submodule.Quotient.mk_surjective _ x\n have hx : x \u2208 m \u2022 (\u22a4 : Submodule A M) := by rw [h]; exact Submodule.mem_top\n -- The quotient map sends `m M` into `m (M \u29f8 J M)`, which is `(m \u29f8 J) (M \u29f8 J M)`.\n rw [\u2190 Submodule.restrictScalars_mem A, \u2190 Ideal.Quotient.algebraMap_eq,\n Ideal.smul_restrictScalars, Submodule.restrictScalars_top]\n exact Submodule.smul_top_le_comap_smul_top m (J \u2022 \u22a4 : Submodule A M).mkQ hx", "proof_lines": 13, "proof_length": 667, "rev": "75c8aed5fea63047615a25a9763fd5b68a86e891", "heartbeats": 1567, "image": "lean-compression:tauceti-75c8aed5fe-a608030cfc", "split": "dev"} {"path": "TauCeti/RingTheory/Grassmannian/Chart/Transition.lean", "module": "TauCeti.RingTheory.Grassmannian.Chart.Transition", "theorem": "Module.Grassmannian.mem_chart_iff_isUnit_det_chartMatrix", "prefix": "/-\nCopyright (c) 2026 The Tau Ceti contributors. All rights reserved.\nReleased under Apache 2.0 license as described in the file LICENSE.\nAuthors: The Tau Ceti contributors\n-/\nmodule\n\npublic import Mathlib.LinearAlgebra.Matrix.Determinant.Basic\npublic import Mathlib.RingTheory.Localization.Away.Basic\npublic import TauCeti.RingTheory.Grassmannian.Chart.Basic\n\nimport Mathlib.LinearAlgebra.Determinant\nimport Mathlib.LinearAlgebra.Matrix.NonsingularInverse\n\n/-!\n# Transition maps between the standard charts of the Grassmannian\n\nLet `M` be a module over a commutative ring `R` and let `x y : Fin k \u2192 M`. A point `N` of the\nchart of `G(k, M; R)` at `x` is the kernel of a unique linear map `\u03c6 : M \u2192 R^k` with\n`\u03c6 (x i) = e\u1d62` (`Module.Grassmannian.chartEquiv`). Its **transition matrix** to `y`,\n`Module.Grassmannian.chartMatrix N y`, has `j`-th column `\u03c6 (y j)`: the coordinates of the image of\n`y j` in the basis of `M \u29f8 N` given by the images of the `x i`. The point `N` lies in the chart at\n`y` exactly when this matrix is invertible, that is, when its determinant is a unit\n(`Module.Grassmannian.mem_chart_iff_isUnit_det_chartMatrix`), and then the linear maps attached to\n`N` in the two charts are related by the transition matrix\n(`Module.Grassmannian.chartEquiv_apply_eq_chartMatrix_mulVec`).\n\nApplied to the universal point of the chart at `x`, this describes the overlap of two charts as a\nbasic open set. The determinant `Module.Grassmannian.ChartAlgebra.transitionDet R x y` of the\nuniversal transition matrix lies in the coordinate ring `ChartAlgebra R x` of the chart at `x`, and\nthe point of the chart at `x` classified by `g : ChartAlgebra R x \u2192\u2090[R] A` lies in the chart at `y`\nexactly when `g (transitionDet R x y)` is a unit\n(`Module.Grassmannian.chartHomEquiv_mem_chart_iff`). So inside `Spec (ChartAlgebra R x)` the chart\nat `y` is the basic open set of `transitionDet R x y`: the overlap of the two charts is\ncorepresented by the localization `Module.Grassmannian.OverlapAlgebra R x y` of `ChartAlgebra R x`\naway from `transitionDet R x y` (`Module.Grassmannian.overlapHomEquiv`,\n`Module.Grassmannian.overlapCorepresentableBy`).\n\nSince `OverlapAlgebra R x y` and `OverlapAlgebra R y x` corepresent the same points, they are\nisomorphic. The **transition isomorphism**\n`Module.Grassmannian.transitionAlgEquiv R x y : OverlapAlgebra R y x \u2243\u2090[R] OverlapAlgebra R x y`\nis the isomorphism compatible with the points\n(`Module.Grassmannian.overlapHomEquiv_comp_transitionAlgEquiv`). On the universal points it is\ngiven by the universal transition matrix\n(`Module.Grassmannian.transitionMatrix_mulVec_transitionAlgEquiv`), its inverse is the transition\nisomorphism in the other direction (`Module.Grassmannian.transitionAlgEquiv_symm`), and it is the\nidentity on the overlap of a chart with itself (`Module.Grassmannian.transitionAlgEquiv_self`).\nUnder `Spec`, these are the transition maps along which the charts glue to the Grassmannian\nscheme.\n\n## Main definitions\n\n* `Module.Grassmannian.chartMatrix N y`: the transition matrix to `y` of a point `N` of a chart.\n* `Module.Grassmannian.ChartAlgebra.transitionMatrix R x y` and\n `Module.Grassmannian.ChartAlgebra.transitionDet R x y`: the universal transition matrix from the\n chart at `x` to `y`, and its determinant.\n* `Module.Grassmannian.OverlapAlgebra R x y`: the coordinate ring of the overlap of the charts at\n `x` and `y`, the localization of `ChartAlgebra R x` away from `transitionDet R x y`.\n* `Module.Grassmannian.overlapHomEquiv R x y A`: `R`-algebra maps `OverlapAlgebra R x y \u2192 A` are the\n points over `A` lying in both charts.\n* `Module.Grassmannian.transitionAlgEquiv R x y`: the transition isomorphism\n `OverlapAlgebra R y x \u2243\u2090[R] OverlapAlgebra R x y`.\n\n## References\n\n* A. Grothendieck, J. Dieudonn\u00e9, *\u00c9l\u00e9ments de g\u00e9om\u00e9trie alg\u00e9brique I* (Springer, 1971), 9.7.\n* [The Stacks Project, Tag 089R](https://stacks.math.columbia.edu/tag/089R), for the Grassmannian\n functor.\n-/\n\npublic section\n\nuniverse u v w\n\nopen CategoryTheory TensorProduct Matrix\n\nnamespace Module.Grassmannian\n\nvariable {R : Type u} [CommRing R] {M : Type v} [AddCommGroup M] [Module R M] {k : \u2115}\n\nsection ChartMatrix\n\n/-- The **transition matrix** to `y : Fin k \u2192 M` of a point `N` of the chart at `x`: its `j`-th\ncolumn is `\u03c6 (y j)`, where `\u03c6 : M \u2192 R^k` is the linear map with kernel `N` and `\u03c6 (x i) = e\u1d62`. These\nare the coordinates of the image of `y j` in the basis of `M \u29f8 N` given by the images of the\n`x i`. -/\nnoncomputable def chartMatrix {x : Fin k \u2192 M} (N : chart R x) (y : Fin k \u2192 M) :\n Matrix (Fin k) (Fin k) R :=\n .of fun i j \u21a6 (chartEquiv R x N).val (y j) i\n\n@[simp]\ntheorem chartMatrix_apply {x : Fin k \u2192 M} (N : chart R x) (y : Fin k \u2192 M) (i j : Fin k) :\n chartMatrix N y i j = (chartEquiv R x N).val (y j) i :=\n (rfl)\n\n/-- The transition matrix of a point of the chart at `x` to `x` itself is the identity. -/\n@[simp]\ntheorem chartMatrix_self {x : Fin k \u2192 M} (N : chart R x) : chartMatrix N x = 1 := by\n ext i j\n simp [Matrix.one_apply, Pi.single_apply]\n\n", "statement": "/-- A point `N` of the chart at `x` lies in the chart at `y` exactly when its transition matrix to\n`y` is invertible, that is, when the determinant of this matrix is a unit. -/\ntheorem mem_chart_iff_isUnit_det_chartMatrix {x : Fin k \u2192 M} (N : chart R x) (y : Fin k \u2192 M) :\n N.val \u2208 chart R y \u2194 IsUnit (chartMatrix N y).det ", "proof": " by\n -- `R^k \u2192 M \u29f8 N` given by `y` is `R^k \u2243 M \u29f8 N` after the endomorphism `\u03c6 \u2218 y` of `R^k`\n have h : N.val.toSubmodule.mkQ \u2218\u2097 Fintype.linearCombination R y =\n (chartQuotEquiv N).toLinearMap \u2218\u2097 (chartEquiv R x N).val \u2218\u2097 Fintype.linearCombination R y :=\n LinearMap.ext fun v \u21a6 (chartQuotEquiv_chartEquiv_apply x N _).symm\n have hmat : LinearMap.toMatrix' ((chartEquiv R x N).val \u2218\u2097 Fintype.linearCombination R y) =\n chartMatrix N y := by\n ext i j\n simp [LinearMap.toMatrix'_apply, Fintype.linearCombination_apply_single]\n rw [mem_chart_iff, h, LinearMap.coe_comp, LinearEquiv.coe_coe, EquivLike.comp_bijective,\n \u2190 Module.End.isUnit_iff, LinearMap.isUnit_iff_isUnit_det, \u2190 LinearMap.det_toMatrix', hmat]", "proof_lines": 10, "proof_length": 603, "rev": "75c8aed5fea63047615a25a9763fd5b68a86e891", "heartbeats": 1159, "image": "lean-compression:tauceti-75c8aed5fe-a608030cfc", "split": "dev"} {"path": "TauCeti/RingTheory/MvPolynomial/SAGBI/Subduction.lean", "module": "TauCeti.RingTheory.MvPolynomial.SAGBI.Subduction", "theorem": "MonomialOrder.isSAGBIBasis_iff_forall_mem_span", "prefix": "/-\nCopyright (c) 2026 The Tau Ceti contributors. All rights reserved.\nReleased under Apache 2.0 license as described in the file LICENSE.\nAuthors: The Tau Ceti contributors\n-/\nmodule\n\npublic import TauCeti.RingTheory.MvPolynomial.SAGBI.Remainder\n\n/-!\n# Polynomial certificates for SAGBI subduction\n\nFor an indexed nonzero SAGBI family `b`, every element of its subalgebra has a polynomial\nexpression whose monomials substitute to products with leading exponent at most that of the\nelement. The bound is on each exponent in the expression's support, not just on the degree of\nits substituted value. Such bounds are needed to lift binomial relations among leading\nmonomials to relations among the generators.\n\nIf the element is zero or has leading exponent strictly below a given bound, we construct a\nstrict subduction certificate, taking the zero polynomial when the element vanishes. This\nalso covers scalar generators and bounds of exponent zero, without asserting a strict bound\non the totalized degree of zero. The binomial certificates for monic families are provided in\n`TauCeti.RingTheory.MvPolynomial.SAGBI.Criterion`.\n\nFor an arbitrary SAGBI set, `IsSAGBIBasis.mem_span` gives the corresponding bounded linear\ncombination of products. These representations characterize SAGBI bases\n(`isSAGBIBasis_iff_forall_mem_span`) and imply that a SAGBI basis generates its algebra\n(`IsSAGBIBasis.adjoin_eq`).\n\n## References\n\n* W. Bruns, A. Conca, F. Lembo, *Sagbi bases, defining equations and algebras of minors*,\n arXiv:2504.10019, \u00a72.\n* B. Sturmfels, *Gr\u00f6bner Bases and Convex Polytopes*, Chapter 11.\n-/\n\npublic section\n\nnamespace MonomialOrder\n\nopen MvPolynomial\n\nvariable {\u03c3 \u03b9 k : Type*} [Field k] {m : MonomialOrder \u03c3}\n {b : \u03b9 \u2192 MvPolynomial \u03c3 k} {A : Subalgebra k (MvPolynomial \u03c3 k)}\n {f : MvPolynomial \u03c3 k}\n\n/-- Subduction in an indexed nonzero SAGBI family produces a polynomial expression with an\nexplicit bound on every substituted monomial's leading exponent. The family need not be\nfinite or monic. -/\ntheorem IsSAGBIBasis.exists_aeval_eq_support_le\n (h : m.IsSAGBIBasis (Set.range b) A) (hb : \u2200 i, b i \u2260 0) (hf : f \u2208 A) :\n \u2203 Q : MvPolynomial \u03b9 k, aeval b Q = f \u2227\n \u2200 u \u2208 Q.support, Finsupp.linearCombination \u2115 (m.degree \u2218 b) u \u227c[m] m.degree f := by\n obtain \u27e8Q, r, hs\u27e9 := m.exists_isSubduction hb f\n exact \u27e8Q, by simpa [hs.remainder_eq_zero h hf] using hs.eq_aeval_add.symm, hs.support_le\u27e9\n\n/-- If an element of a SAGBI subalgebra is zero or has leading exponent below `a`, it has an\nexpression all of whose substituted monomials have leading exponent strictly below `a`.\nThe zero case is certified by the empty support, including when `a = 0`. -/\ntheorem IsSAGBIBasis.exists_aeval_eq_support_lt\n (h : m.IsSAGBIBasis (Set.range b) A) (hb : \u2200 i, b i \u2260 0) (hf : f \u2208 A)\n {a : \u03c3 \u2192\u2080 \u2115} (hfa : f = 0 \u2228 m.degree f \u227a[m] a) :\n \u2203 Q : MvPolynomial \u03b9 k, aeval b Q = f \u2227\n \u2200 u \u2208 Q.support, Finsupp.linearCombination \u2115 (m.degree \u2218 b) u \u227a[m] a := by\n rcases hfa with rfl | hfa\n \u00b7 exact \u27e80, by simp, by simp\u27e9\n \u00b7 obtain \u27e8Q, hQ, hbound\u27e9 := h.exists_aeval_eq_support_le hb hf\n exact \u27e8Q, hQ, fun u hu \u21a6 (hbound u hu).trans_lt hfa\u27e9\n\nvariable {B : Set (MvPolynomial \u03c3 k)}\n\n/-- **Subduction.** Every element `f` of a subalgebra `A` with SAGBI basis `B` is a `k`-linear\ncombination of products of elements of `B` whose leading exponents are at most that of `f`. -/\ntheorem IsSAGBIBasis.mem_span (h : m.IsSAGBIBasis B A) (hf : f \u2208 A) :\n f \u2208 Submodule.span k {g \u2208 Submonoid.closure B | m.degree g \u227c[m] m.degree f} := by\n classical\n let b : \u21a5(B \\ {0}) \u2192 MvPolynomial \u03c3 k := Subtype.val\n have hrange : Set.range b = B \\ {0} := Subtype.range_coe_subtype\n have hb : \u2200 i, b i \u2260 0 := fun i \u21a6 i.property.2\n have hB : m.IsSAGBIBasis (Set.range b) A := by\n rw [hrange]\n exact isSAGBIBasis_sdiff_singleton_zero.2 h\n obtain \u27e8Q, hQ, hbound\u27e9 := hB.exists_aeval_eq_support_le hb hf\n suffices aeval b Q \u2208\n Submodule.span k {g \u2208 Submonoid.closure B | m.degree g \u227c[m] m.degree f} by\n rwa [hQ] at this\n rw [Q.as_sum, map_sum]\n refine Submodule.sum_mem _ fun u hu \u21a6 ?_\n have hprod : aeval b (monomial u (1 : k)) \u2208 Submonoid.closure B := by\n rw [aeval_monomial, map_one, one_mul]\n exact Submonoid.prod_mem _ fun i _ \u21a6\n pow_mem (Submonoid.subset_closure i.property.1) _\n have hdegree : m.degree (aeval b (monomial u (1 : k))) \u227c[m] m.degree f := by\n rw [m.degree_aeval_monomial_one_of_ne_zero hb]\n exact hbound u hu\n have hmem : aeval b (monomial u (1 : k)) \u2208\n Submodule.span k {g \u2208 Submonoid.closure B | m.degree g \u227c[m] m.degree f} :=\n Submodule.subset_span \u27e8hprod, hdegree\u27e9\n simpa only [\u2190 map_smul, smul_monomial, smul_eq_mul, mul_one] using\n Submodule.smul_mem _ (Q.coeff u) hmem\n\n", "statement": "/-- Over a field, `B \u2286 A` is a SAGBI basis of `A` if and only if every element `f` of `A` is a\n`k`-linear combination of products of elements of `B` whose leading exponents are at most that\nof `f`. -/\ntheorem isSAGBIBasis_iff_forall_mem_span :\n m.IsSAGBIBasis B A \u2194 B \u2286 A \u2227\n \u2200 f \u2208 A, f \u2208 Submodule.span k {g \u2208 Submonoid.closure B | m.degree g \u227c[m] m.degree f} ", "proof": " by\n refine \u27e8fun h \u21a6 \u27e8h.subset, fun f \u21a6 h.mem_span\u27e9, fun \u27e8hBA, h\u27e9 \u21a6\n isSAGBIBasis_iff_exists_mem_closure.2 \u27e8hBA, fun f hf hf0 \u21a6 ?_\u27e9\u27e9\n -- Otherwise every product in the representation of `f` has vanishing coefficient at the leading\n -- exponent of `f`, and so does `f`.\n by_contra hne\n simp only [not_exists, not_and] at hne\n have hker : Submodule.span k {g \u2208 Submonoid.closure B | m.degree g \u227c[m] m.degree f} \u2264\n LinearMap.ker (lcoeff k (m.degree f)) := by\n refine Submodule.span_le.2 fun g \u27e8hg, hgf\u27e9 \u21a6 ?_\n rw [SetLike.mem_coe, LinearMap.mem_ker, lcoeff_apply]\n by_contra hc\n exact hne g hg (fun h0 \u21a6 hc (by simp [h0]))\n (m.toSyn.injective (le_antisymm hgf (m.le_degree (mem_support_iff.2 hc))))\n have hf' := hker (h f hf)\n rw [LinearMap.mem_ker, lcoeff_apply] at hf'\n exact hf0 (m.coeff_degree_eq_zero_iff.1 hf')", "proof_lines": 16, "proof_length": 661, "rev": "75c8aed5fea63047615a25a9763fd5b68a86e891", "heartbeats": 832, "image": "lean-compression:tauceti-75c8aed5fe-a608030cfc", "split": "dev"} {"path": "TauCeti/LinearAlgebra/Multilinear/Quotient.lean", "module": "TauCeti.LinearAlgebra.Multilinear.Quotient", "theorem": "MultilinearMap.apply_eq_of_mkQ_eq", "prefix": "/-\nCopyright (c) 2026 The Tau Ceti contributors. All rights reserved.\nReleased under Apache 2.0 license as described in the file LICENSE.\nAuthors: The Tau Ceti contributors\n-/\nmodule\n\npublic import Mathlib.LinearAlgebra.Multilinear.Basic\npublic import Mathlib.LinearAlgebra.Quotient.Basic\n\n/-!\n# Multilinear maps on quotient modules\n\nA multilinear map on finitely many modules descends to their quotients if it vanishes\nwhenever one argument belongs to the submodule being divided out. `MultilinearMap.liftQ`\nconstructs the descended map, characterized by evaluation on quotient classes.\nThis permits tensor constructions with different quotient modules in different slots.\n-/\n\npublic section\n\nnamespace MultilinearMap\n\nvariable {R \u03b9 : Type*} [Ring R] [Finite \u03b9]\n {M : \u03b9 \u2192 Type*} [\u2200 i, AddCommGroup (M i)] [\u2200 i, Module R (M i)]\n {P : Type*} [AddCommMonoid P] [Module R P]\n\n", "statement": "/-- A multilinear map killing a submodule in each slot takes the same value on tuples\nrepresenting the same quotient classes. -/\ntheorem apply_eq_of_mkQ_eq (f : MultilinearMap (RingHom.id R) M P) (N : \u2200 i, Submodule R (M i))\n (hf : \u2200 [DecidableEq \u03b9] (m : \u2200 i, M i) (i : \u03b9) (x : M i),\n x \u2208 N i \u2192 f (Function.update m i x) = 0)\n {a b : \u2200 i, M i} (h : \u2200 i, (N i).mkQ (a i) = (N i).mkQ (b i)) : f a = f b ", "proof": " by\n classical\n let := Fintype.ofFinite \u03b9\n have hab (i : \u03b9) : a i - b i \u2208 N i := (Submodule.Quotient.eq _).mp (h i)\n have heq : a = (a - b) + b := by simp\n rw [heq, f.map_add_univ, Finset.sum_eq_single \u2205]\n \u00b7 simp\n \u00b7 intro s _ hs\n obtain \u27e8i, hi\u27e9 := Finset.ne_empty_iff_nonempty.mp hs\n have hi' : (s.piecewise (a - b) b) i = a i - b i :=\n Finset.piecewise_eq_of_mem s (a - b) b hi\n simpa only [\u2190 hi', Function.update_eq_self] using\n hf (s.piecewise (a - b) b) i (a i - b i) (hab i)\n \u00b7 simp", "proof_lines": 13, "proof_length": 473, "rev": "75c8aed5fea63047615a25a9763fd5b68a86e891", "heartbeats": 734, "image": "lean-compression:tauceti-75c8aed5fe-a608030cfc", "split": "dev"} {"path": "TauCeti/Topology/PartitionOfUnity/Gap.lean", "module": "TauCeti.Topology.PartitionOfUnity.Gap", "theorem": "PartitionOfUnity.gap_pos_iff", "prefix": "/-\nCopyright (c) 2026 The Tau Ceti contributors. All rights reserved.\nReleased under Apache 2.0 license as described in the file LICENSE.\nAuthors: The Tau Ceti contributors\n-/\nmodule\n\npublic import Mathlib.Topology.PartitionOfUnity\nimport TauCeti.Topology.Order.Lattice\n\n/-!\n# Finite-subset gaps of a partition of unity and their countable recolouring\n\nLet `\u03c1` be a partition of unity with weights `(\u03c1 i)_{i \u2208 \u03b9}`, where `\u03b9` may be uncountable. For a\nfinite set `E` of indices, the *gap* of `E` at `x` is\n`\u03c1.gap E x = max 0 (min_{i \u2208 E} \u03c1 i x - sup_{i \u2209 E} \u03c1 i x)`,\nwith the supremum of an empty family read as `0`; the gap of `\u2205` is `0`.\n\nA positive gap at `x` means that `E` is a strict top segment of the weights at `x`: every weight\nin `E` is positive and strictly exceeds every weight outside `E`. Consequently the sets with a\npositive gap at a point form a chain, so at most one of them has any prescribed cardinality.\nInformally, if the positive weights at `x` are listed with multiplicity as `a\u2081 \u2265 \u22ef \u2265 a\u2098 > 0` and\n`a\u2098\u208a\u2081 = 0`, the set of the first `n` indices has gap `a\u2099 - a\u2099\u208a\u2081`, and ties give gap zero. The\nbasic identity is that the gaps of the sets containing a fixed index `j` add up to `\u03c1 j x`;\nsumming over `j` gives `\u2211\u1da0 E, #E * \u03c1.gap E x = \u2211\u1da0 i, \u03c1 i x`.\n\nEach gap is continuous: near any point only finitely many weights are nonzero, and there the gap\nis a finite expression in continuous functions. Grouping the gaps by cardinality, the functions\n`n * \u2211\u1da0_{#E = n} \u03c1.gap E` form a partition of unity indexed by `\u2115`, on the same set as `\u03c1`. Thus\nany partition of unity, indexed by an arbitrary type, gives a countable one, and wherever the\n`n`-th new weight is positive it is carried by a single set `E` of size `n` all of whose original\nweights are positive. When `\u03c1` is subordinate to a cover `U`, this means that `x \u2208 U i` for all\n`i \u2208 E`.\n\nThis is the countable colouring used to build classifying maps of numerable bundles into\nGrassmannians of `\u2115 \u2192\u2080 \ud835\udd5c`: on the region where a set `E` of size `n` has positive gap, a chart\nof any index in `E` provides a local frame, and the `n`-th colour weights these frames. The\npositivity sets of the gaps are the open sets used in the proof of Lemma 5.9 of Milnor\u2013Stasheff,\n*Characteristic classes*, to refine a locally finite trivializing cover to a countable one.\n\n## Main definitions and results\n\n* `PartitionOfUnity.gap`: the gap of a finite set of indices.\n* `PartitionOfUnity.continuous_gap`: each gap is continuous.\n* `PartitionOfUnity.gap_pos_iff`: `E` has positive gap exactly when it is a nonempty strict top\n segment of positive weights.\n* `PartitionOfUnity.eq_of_gap_pos_of_card_eq`: two sets of equal size with positive gaps at the\n same point coincide.\n* `PartitionOfUnity.finsum_mem_gap`: the gaps of the sets containing `j` sum to `\u03c1 j x`.\n* `PartitionOfUnity.finsum_card_mul_gap`: `\u2211\u1da0 E, #E * \u03c1.gap E x = \u2211\u1da0 i, \u03c1 i x`.\n* `PartitionOfUnity.gapPartition`: the partition of unity indexed by `\u2115` grouping gaps by size.\n* `PartitionOfUnity.gapPartition_card_eq`: where `E` has positive gap, the colour of size `#E`\n is `#E * \u03c1.gap E x`.\n-/\n\npublic section\n\nopen Function Set Filter Topology\n\nnamespace PartitionOfUnity\n\nvariable {\u03b9 X : Type*} [TopologicalSpace X] {s : Set X} (\u03c1 : PartitionOfUnity \u03b9 X s)\n\n/-- The gap of a finite set `E` of indices of a partition of unity at `x`: the excess of the\nsmallest weight in `E` over the largest weight outside `E`, truncated below at `0`. The supremum\nover an empty complement is `0`, and the gap of `\u2205` is `0`. -/\nnoncomputable def gap (E : Finset \u03b9) (x : X) : \u211d :=\n max 0 ((\u2a05 i : E, \u03c1 i x) - \u2a06 i : {i // i \u2209 E}, \u03c1 i x)\n\n/-- The defining equation of `PartitionOfUnity.gap`. -/\ntheorem gap_def (E : Finset \u03b9) (x : X) :\n \u03c1.gap E x = max 0 ((\u2a05 i : E, \u03c1 i x) - \u2a06 i : {i // i \u2209 E}, \u03c1 i x) :=\n (rfl)\n\n/-- Gaps are nonnegative. -/\ntheorem gap_nonneg (E : Finset \u03b9) (x : X) : 0 \u2264 \u03c1.gap E x :=\n le_max_left _ _\n\nvariable {\u03c1}\n\n/-! ### Elementary bounds on the infimum and the supremum -/\n\nprivate theorem bddAbove_range_compl (E : Finset \u03b9) (x : X) :\n BddAbove (range fun i : {i // i \u2209 E} \u21a6 \u03c1 i x) :=\n \u27e81, forall_mem_range.2 fun i \u21a6 \u03c1.le_one i x\u27e9\n\nprivate theorem iSup_compl_nonneg (E : Finset \u03b9) (x : X) :\n 0 \u2264 \u2a06 i : {i // i \u2209 E}, \u03c1 i x :=\n Real.iSup_nonneg fun i \u21a6 \u03c1.nonneg i x\n\nprivate theorem le_iSup_compl {E : Finset \u03b9} {j : \u03b9} (hj : j \u2209 E) (x : X) :\n \u03c1 j x \u2264 \u2a06 i : {i // i \u2209 E}, \u03c1 i x :=\n le_ciSup (f := fun i : {i // i \u2209 E} \u21a6 \u03c1 i x) (bddAbove_range_compl E x) \u27e8j, hj\u27e9\n\nprivate theorem iInf_le_of_mem {E : Finset \u03b9} {j : \u03b9} (hj : j \u2208 E) (x : X) :\n \u2a05 i : E, \u03c1 i x \u2264 \u03c1 j x :=\n ciInf_le (f := fun i : E \u21a6 \u03c1 i x) (finite_range _).bddBelow \u27e8j, hj\u27e9\n\nprivate theorem iInf_eq_of_mem {E : Finset \u03b9} {j : \u03b9} {x : X} (hj : j \u2208 E)\n (h : \u2200 i \u2208 E, \u03c1 j x \u2264 \u03c1 i x) : \u2a05 i : E, \u03c1 i x = \u03c1 j x :=\n have : Nonempty E := \u27e8\u27e8j, hj\u27e9\u27e9\n le_antisymm (iInf_le_of_mem hj x) (le_ciInf fun i \u21a6 h i i.property)\n\nprivate theorem iSup_compl_eq_of_notMem {E : Finset \u03b9} {k : \u03b9} {x : X} (hk : k \u2209 E)\n (h : \u2200 i \u2209 E, \u03c1 i x \u2264 \u03c1 k x) : \u2a06 i : {i // i \u2209 E}, \u03c1 i x = \u03c1 k x :=\n have : Nonempty {i // i \u2209 E} := \u27e8\u27e8k, hk\u27e9\u27e9\n le_antisymm (ciSup_le fun i \u21a6 h i i.property) (le_iSup_compl hk x)\n\nprivate theorem iSup_compl_eq_zero {E : Finset \u03b9} {x : X} (h : \u2200 i \u2209 E, \u03c1 i x = 0) :\n \u2a06 i : {i // i \u2209 E}, \u03c1 i x = 0 :=\n le_antisymm (Real.iSup_le (fun i \u21a6 (h i i.property).le) le_rfl) (iSup_compl_nonneg E x)\n\n/-- Where all weights outside a finite set `I` vanish, the supremum over the complement of `E`\nis the supremum over the finite set `I \\ E`. -/\nprivate theorem iSup_compl_eq_iSup_sdiff [DecidableEq \u03b9] {I E : Finset \u03b9} {x : X}\n (hI : support (\u03c1 \u00b7 x) \u2286 I) :\n \u2a06 i : {i // i \u2209 E}, \u03c1 i x = \u2a06 i : (I \\ E : Finset \u03b9), \u03c1 i x := by\n have hnonneg : 0 \u2264 \u2a06 i : (I \\ E : Finset \u03b9), \u03c1 i x := Real.iSup_nonneg fun i \u21a6 \u03c1.nonneg i x\n refine le_antisymm (Real.iSup_le (fun i \u21a6 ?_) hnonneg)\n (Real.iSup_le (fun i \u21a6 le_iSup_compl (Finset.mem_sdiff.1 i.property).2 x)\n (iSup_compl_nonneg E x))\n by_cases hi : i.val \u2208 I\n \u00b7 exact le_ciSup (f := fun i : (I \\ E : Finset \u03b9) \u21a6 \u03c1 i x) (finite_range _).bddAbove\n \u27e8i, Finset.mem_sdiff.2 \u27e8hi, i.property\u27e9\u27e9\n \u00b7 rw [show \u03c1 i x = 0 from notMem_support.1 fun h \u21a6 hi (hI h)]\n exact hnonneg\n\n/-! ### Positive gaps -/\n\nprivate theorem iSup_lt_iInf_of_gap_pos {E : Finset \u03b9} {x : X} (h : 0 < \u03c1.gap E x) :\n \u2a06 i : {i // i \u2209 E}, \u03c1 i x < \u2a05 i : E, \u03c1 i x := by\n rw [gap, lt_max_iff] at h\n exact sub_pos.1 (h.resolve_left (lt_irrefl 0))\n\n/-- If `E` has positive gap at `x`, every weight in `E` strictly exceeds every weight outside\n`E`. -/\ntheorem lt_of_gap_pos {E : Finset \u03b9} {x : X} (h : 0 < \u03c1.gap E x) {i j : \u03b9} (hi : i \u2208 E)\n (hj : j \u2209 E) : \u03c1 j x < \u03c1 i x :=\n (le_iSup_compl hj x).trans_lt <| (iSup_lt_iInf_of_gap_pos h).trans_le (iInf_le_of_mem hi x)\n\n/-- If `E` has positive gap at `x`, every weight in `E` is positive at `x`. -/\ntheorem pos_of_gap_pos {E : Finset \u03b9} {x : X} (h : 0 < \u03c1.gap E x) {i : \u03b9} (hi : i \u2208 E) :\n 0 < \u03c1 i x :=\n (iSup_compl_nonneg E x).trans_lt <| (iSup_lt_iInf_of_gap_pos h).trans_le (iInf_le_of_mem hi x)\n\n/-- A set with positive gap at `x` consists of indices whose weights are nonzero at `x`. -/\ntheorem subset_finsupport_of_gap_pos {E : Finset \u03b9} {x : X} (h : 0 < \u03c1.gap E x) :\n E \u2286 \u03c1.finsupport x := fun _ hi \u21a6\n (\u03c1.mem_finsupport x).2 (pos_of_gap_pos h hi).ne'\n\n/-- Gaps are nonnegative, so a gap is positive exactly when it is nonzero. -/\ntheorem gap_pos_iff_ne_zero {E : Finset \u03b9} {x : X} : 0 < \u03c1.gap E x \u2194 \u03c1.gap E x \u2260 0 :=\n (\u03c1.gap_nonneg E x).lt_iff_ne'\n\n/-- A set with positive gap at `x` contains every index whose weight at `x` is at least the\nweight of one of its members. -/\ntheorem mem_of_gap_pos_of_le {E : Finset \u03b9} {x : X} (h : 0 < \u03c1.gap E x) {i j : \u03b9} (hj : j \u2208 E)\n (hji : \u03c1 j x \u2264 \u03c1 i x) : i \u2208 E := by\n by_contra hi\n exact (lt_of_gap_pos h hj hi).not_ge hji\n\n@[simp]\ntheorem gap_empty (x : X) : \u03c1.gap \u2205 x = 0 := by\n rw [gap, Real.iInf_of_isEmpty, zero_sub, max_eq_left (neg_nonpos.2 (iSup_compl_nonneg _ x))]\n\n", "statement": "/-- A finite set has positive gap at `x` exactly when it is nonempty, its weights at `x` are\npositive, and they strictly exceed every weight outside it. -/\ntheorem gap_pos_iff {E : Finset \u03b9} {x : X} :\n 0 < \u03c1.gap E x \u2194 E.Nonempty \u2227 (\u2200 i \u2208 E, 0 < \u03c1 i x) \u2227 \u2200 i \u2208 E, \u2200 j \u2209 E, \u03c1 j x < \u03c1 i x ", "proof": " by\n classical\n refine \u27e8fun h \u21a6 \u27e8Finset.ne_empty_iff_nonempty.1 ?_, fun i hi \u21a6 pos_of_gap_pos h hi,\n fun i hi j hj \u21a6 lt_of_gap_pos h hi hj\u27e9, fun \u27e8hne, hpos, hlt\u27e9 \u21a6 ?_\u27e9\n \u00b7 rintro rfl\n exact h.ne' (gap_empty x)\n have : Nonempty E := hne.to_subtype\n obtain \u27e8\u27e8i, hi\u27e9, hmin\u27e9 := exists_eq_ciInf_of_finite (f := fun i : E \u21a6 \u03c1 i x)\n rw [gap, lt_max_iff, sub_pos, \u2190 hmin, iSup_compl_eq_iSup_sdiff (\u03c1.coe_finsupport x).superset]\n refine Or.inr ?_\n rcases isEmpty_or_nonempty (\u03c1.finsupport x \\ E : Finset \u03b9) with h | h\n \u00b7 rw [Real.iSup_of_isEmpty]\n exact hpos i hi\n \u00b7 obtain \u27e8\u27e8k, hk\u27e9, hmax\u27e9 :=\n exists_eq_ciSup_of_finite (f := fun k : (\u03c1.finsupport x \\ E : Finset \u03b9) \u21a6 \u03c1 k x)\n rw [\u2190 hmax]\n exact hlt i hi k (Finset.mem_sdiff.1 hk).2", "proof_lines": 16, "proof_length": 704, "rev": "75c8aed5fea63047615a25a9763fd5b68a86e891", "heartbeats": 534, "image": "lean-compression:tauceti-75c8aed5fe-a608030cfc", "split": "dev"} {"path": "TauCeti/Analysis/SpecialFunctions/Elliptic/Uniformization.lean", "module": "TauCeti.Analysis.SpecialFunctions.Elliptic.Uniformization", "theorem": "PeriodPair.pointAddEquivOfLatticeEq_weierstrassPoint", "prefix": "/-\nCopyright (c) 2026 The Tau Ceti contributors. All rights reserved.\nReleased under Apache 2.0 license as described in the file LICENSE.\nAuthors: The Tau Ceti contributors\n-/\nmodule\n\npublic import Mathlib.AlgebraicGeometry.EllipticCurve.Projective.Point\npublic import TauCeti.Analysis.Complex.ModularForms.LevelOne.JInputs\npublic import TauCeti.Analysis.Complex.UpperHalfPlane.PeriodPair\npublic import TauCeti.AlgebraicGeometry.EllipticCurve.Affine.Point.Pointed.Basic\npublic import TauCeti.AlgebraicGeometry.EllipticCurve.NormalForms\nimport Mathlib.Analysis.Calculus.InverseFunctionTheorem.Deriv\nimport Mathlib.Analysis.Complex.Liouville\nimport Mathlib.NumberTheory.LSeries.HurwitzZetaValues\nimport Mathlib.NumberTheory.ModularForms.LevelOne.GradedRing\nimport TauCeti.AlgebraicGeometry.EllipticCurve.Affine.Point.Basic\nimport TauCeti.AlgebraicGeometry.EllipticCurve.Weierstrass\n\n/-!\n# The Weierstrass curve of a period lattice\n\nA period pair `L` with lattice `\u039b` has the lattice invariants `g\u2082 = 60 \u2211' \u03bb\u207b\u2074` and\n`g\u2083 = 140 \u2211' \u03bb\u207b\u2076` (`PeriodPair.g\u2082`, `PeriodPair.g\u2083`), and Mathlib proves the differential equation\n`\u2118'\u00b2 = 4 \u2118\u00b3 - g\u2082 \u2118 - g\u2083` (`PeriodPair.derivWeierstrassP_sq`). Dividing `\u2118'` by `2` turns this into\na Weierstrass equation with leading coefficient one, so this file attaches to `L` the Weierstrass\ncurve\n\n `y\u00b2 = x\u00b3 - (g\u2082 / 4) x - g\u2083 / 4`\n\n(`PeriodPair.weierstrassCurve`) and the map `z \u21a6 (\u2118(z), \u2118'(z) / 2)` from `\u2102` to its points, sending\nthe lattice to the point at infinity (`PeriodPair.weierstrassPoint`). These are the first steps of\nthe complex uniformization `\u2102 / \u039b \u2243 E(\u2102)`.\n\nThe discriminant of the curve is `g\u2082\u00b3 - 27 g\u2083\u00b2`. For the lattice `\u2124 \u03c4 + \u2124` of a point `\u03c4` of the\nupper half-plane, the lattice sums are Eisenstein series, `g\u2082 = (4 \u03c0\u2074 / 3) E\u2084(\u03c4)` and\n`g\u2083 = (8 \u03c0\u2076 / 27) E\u2086(\u03c4)` (by Mathlib's `tsum_eisSummand_eq_riemannZeta_mul_eisensteinSeries`), so\nthe identity `E\u2084\u00b3 - E\u2086\u00b2 = 1728 \u0394` (`ModularForm.discriminant_eq_E\u2084_cube_sub_E\u2086_sq`) gives\n`g\u2082\u00b3 - 27 g\u2083\u00b2 = (2 \u03c0)\u00b9\u00b2 \u0394(\u03c4)`, which does not vanish. Every lattice is a nonzero multiple of such a\nlattice, and rescaling a lattice by `c` multiplies `g\u2082` by `c\u207b\u2074` and `g\u2083` by `c\u207b\u2076`; so the\ndiscriminant never vanishes and the curve is elliptic. Its `j`-invariant is\n`1728 g\u2082\u00b3 / (g\u2082\u00b3 - 27 g\u2083\u00b2)`, which for `\u2124 \u03c4 + \u2124` is the modular invariant `j(\u03c4) = E\u2084(\u03c4)\u00b3 / \u0394(\u03c4)`.\n\nThe point map has holomorphic lifts to projective coordinates. Off the lattice this is the\nholomorphy of `\u2118` and `\u2118'` in the affine chart. Near the point at infinity the projective curve\nis covered by the chart `Y \u2260 0`, with coordinates `x / y = 2 \u2118 / \u2118'` and `1 / y = 2 / \u2118'`. Near a\nlattice point `l\u2080` write `\u2118'(z) = \u2118'_{l\u2080}(z) - 2 / (z - l\u2080)\u00b3` and `\u2118(z) = \u2118_{l\u2080}(z) + 1 / (z - l\u2080)\u00b2\n- 1 / l\u2080\u00b2`, with `\u2118_{l\u2080} = PeriodPair.weierstrassPExcept L l\u2080` and\n`\u2118'_{l\u2080} = PeriodPair.derivWeierstrassPExcept L l\u2080` holomorphic at `l\u2080`; this gives\n\n `1 / \u2118'(z) = (z - l\u2080)\u00b3 / ((z - l\u2080)\u00b3 \u2118'_{l\u2080}(z) - 2)`,\n\nwhose denominator is `-2` at `l\u2080`, and similarly for `\u2118 / \u2118'`. So both chart coordinates are\nholomorphic at `l\u2080`, they vanish there, and `\u2118 / \u2118'` has derivative `-1 / 2` at `l\u2080`. In particular\nthe point map is injective near every lattice point.\n\nThe point map is surjective. By Liouville's theorem `\u2118` takes every value `x`: otherwise\n`1 / (\u2118 - x)`, which near a lattice point `l\u2080` is `(z - l\u2080)\u00b2` divided by a function with value `1`\nat `l\u2080`, would extend by `0` on `\u039b` to a bounded entire `\u039b`-periodic function, hence a constant,\nwhile it vanishes on `\u039b` and nowhere else. A point `(x, y)` of the curve with `\u2118(z) = x` has\n`y = \u00b1 \u2118'(z) / 2`, and `z` or `-z` maps to it.\n\n## Main definitions\n\n* `PeriodPair.weierstrassCurve`: the Weierstrass curve `y\u00b2 = x\u00b3 - (g\u2082 / 4) x - g\u2083 / 4`.\n* `PeriodPair.weierstrassPoint`: the point `(\u2118(z), \u2118'(z) / 2)`, or `0` for `z \u2208 \u039b`.\n* `PeriodPair.pointAddEquivOfLatticeEq`: for `\u039b' = c \u039b`, the isomorphism `E_{\u039b'}(\u2102) \u2243+ E_\u039b(\u2102)`\n given by the change of variables with `u = c`.\n\n## Main results\n\n* `PeriodPair.isShortNF_weierstrassCurve`: the curve is in short normal form.\n* `PeriodPair.weierstrassCurve_smul`: rescaling the lattice by `c` changes the curve by the\n variable change with `u = c`.\n* `UpperHalfPlane.G_periodPair`: `G k (\u2124 \u03c4 + \u2124) = 2 \u03b6(k) E_k(\u03c4)` for `k \u2265 3`.\n* `UpperHalfPlane.mdifferentiable_G_periodPair`: `G k (\u2124 \u03c4 + \u2124)` is holomorphic in `\u03c4` for `k \u2265 3`;\n hence so are `g\u2082(\u2124 \u03c4 + \u2124)` and `g\u2083(\u2124 \u03c4 + \u2124)` (`UpperHalfPlane.mdifferentiable_g\u2082_periodPair`,\n `UpperHalfPlane.mdifferentiable_g\u2083_periodPair`).\n* `UpperHalfPlane.weierstrassCurve_\u0394_periodPair`: the discriminant of the curve of `\u2124 \u03c4 + \u2124` is\n `(2 \u03c0)\u00b9\u00b2 \u0394(\u03c4)`.\n* `PeriodPair.weierstrassCurve_\u0394`, `PeriodPair.weierstrassCurve_\u0394_ne_zero`: the discriminant is\n `g\u2082\u00b3 - 27 g\u2083\u00b2`, and it is nonzero.\n* `PeriodPair.weierstrassCurve_j`, `UpperHalfPlane.weierstrassCurve_j_periodPair`: the\n `j`-invariant, and its identification with the modular invariant `TauCeti.ModularForm.j`.\n* `PeriodPair.weierstrassCurve_j_eq_1728_iff`, `PeriodPair.weierstrassCurve_j_eq_zero_iff`: the\n `j`-invariant is `1728` exactly when `g\u2083 = 0`, and `0` exactly when `g\u2082 = 0`.\n* `PeriodPair.weierstrassPoint_add_coe`, `PeriodPair.weierstrassPoint_neg`,\n `PeriodPair.weierstrassPoint_eq_zero_iff`: the point map is `\u039b`-periodic, odd, and vanishes\n exactly on `\u039b`.\n* `PeriodPair.inv_derivWeierstrassP_eq`, `PeriodPair.weierstrassP_div_derivWeierstrassP_eq`:\n `1 / \u2118'` and `\u2118 / \u2118'` near a lattice point `l\u2080`, in terms of `\u2118_{l\u2080}` and `\u2118'_{l\u2080}`.\n* `PeriodPair.analyticAt_weierstrassP_div_derivWeierstrassP`,\n `PeriodPair.analyticAt_inv_derivWeierstrassP`: the coordinates `\u2118 / \u2118'` and `1 / \u2118'` of the\n chart at infinity are holomorphic on its domain `{\u2118' \u2260 0} \u222a \u039b`.\n* `PeriodPair.hasDerivAt_weierstrassP_div_derivWeierstrassP`: `\u2118 / \u2118'` has derivative `-1 / 2` at\n every lattice point.\n* `PeriodPair.exists_analyticAt_toAffine_eq_weierstrassPoint`: near every point, the point map has\n a holomorphic lift to nonsingular projective coordinates.\n* `PeriodPair.exists_mem_nhds_injOn_weierstrassPoint`: the point map is injective near every\n lattice point.\n* `PeriodPair.exists_weierstrassP_eq`: `\u2118` takes every complex value off the lattice.\n* `PeriodPair.weierstrassPoint_surjective`: every point of the curve is in the image of the\n point map.\n* `PeriodPair.weierstrassCurve_eq_smul_of_lattice_eq`,\n `PeriodPair.weierstrassCurve_j_eq_of_lattice_eq_smul`: for `\u039b' = c \u039b`, the curve of `\u039b'` is the\n change of variables of that of `\u039b` with `u = c`, so homothetic lattices have the same\n `j`-invariant.\n* `PeriodPair.pointAddEquivOfLatticeEq_weierstrassPoint`,\n `PeriodPair.pointAddEquivOfLatticeEq_symm_weierstrassPoint`: rescaling naturality of the point\n map, sending the point of `c z` on `E_{c\u039b}` to the point of `z` on `E_\u039b`. Since the curve only\n depends on the lattice, the same holds for any basis of `c\u039b`.\n* `PeriodPair.smul_mk_weierstrassPoint`: the same rescaling as an isomorphism of pointed curves\n (`TauCeti.PointedWeierstrassCurve`), carrying `E_\u039b` with the point of `z` to `E_{c\u039b}` with the\n point of `c z`.\n\n## References\n\n* J. H. Silverman, *The Arithmetic of Elliptic Curves*, 2nd ed., Graduate Texts in Mathematics\n 106, Springer, 2009, \u00a7VI.3 and \u00a7VI.5.\n* J.-P. Serre, *A Course in Arithmetic*, Graduate Texts in Mathematics 7, Springer, 1973,\n \u00a7VII.2.3 and \u00a7VII.3.3.\n-/\n\npublic noncomputable section\n\nopen Complex ModularForm UpperHalfPlane WeierstrassCurve\n\nopen scoped Real\n\n/-! ### Lattice sums of `\u2124 \u03c4 + \u2124` -/\n\nnamespace UpperHalfPlane\n\n/-- For `k \u2265 3` the lattice sum `G k` of `\u2124 \u03c4 + \u2124` is the Eisenstein series `2 \u03b6(k) E_k(\u03c4)`. -/\nlemma G_periodPair (\u03c4 : \u210d) {k : \u2115} (hk : 3 \u2264 k) :\n \u03c4.periodPair.G k = 2 * riemannZeta k * E hk \u03c4 := by\n have h := tsum_eisSummand_eq_riemannZeta_mul_eisensteinSeries hk \u03c4\n rw [PeriodPair.G,\n \u2190 ((finTwoArrowEquiv \u2124).trans \u03c4.periodPair.latticeEquivProd.symm.toEquiv).tsum_eq]\n -- Mathlib has no evaluation lemma for `E`, which is `(1 / 2) \u2022 eisensteinSeriesSIF` by\n -- definition; Mathlib's `EisensteinSeries.q_expansion_riemannZeta` unfolds it the same way.\n have hE : E hk \u03c4 = (1 / 2 : \u2102) * eisensteinSeries (N := 1) 0 k \u03c4 := rfl\n rw [hE, mul_comm 2, mul_assoc, \u2190 mul_assoc 2, mul_one_div_cancel two_ne_zero, one_mul, \u2190 h]\n refine tsum_congr fun v \u21a6 ?_\n simp [EisensteinSeries.eisSummand, PeriodPair.latticeEquiv_symm_apply]\n\n/-- `g\u2082(\u2124 \u03c4 + \u2124) = (4 \u03c0\u2074 / 3) E\u2084(\u03c4)`. -/\nlemma g\u2082_periodPair (\u03c4 : \u210d) : \u03c4.periodPair.g\u2082 = 4 * \u03c0 ^ 4 / 3 * E\u2084 \u03c4 := by\n rw [PeriodPair.g\u2082, G_periodPair \u03c4 (by norm_num), Nat.cast_ofNat, riemannZeta_four]\n ring\n\n/-- `g\u2083(\u2124 \u03c4 + \u2124) = (8 \u03c0\u2076 / 27) E\u2086(\u03c4)`. -/\nlemma g\u2083_periodPair (\u03c4 : \u210d) : \u03c4.periodPair.g\u2083 = 8 * \u03c0 ^ 6 / 27 * E\u2086 \u03c4 := by\n have h\u03b6 : riemannZeta 6 = \u03c0 ^ 6 / 945 := by\n have h := riemannZeta_two_mul_nat (k := 3) (by norm_num)\n norm_num [show bernoulli 6 = 1 / 42 by decide +kernel, Nat.factorial] at h\n rw [h]\n ring\n rw [PeriodPair.g\u2083, G_periodPair \u03c4 (by norm_num), Nat.cast_ofNat, h\u03b6]\n ring\n\nopen scoped Manifold in\n/-- For `k \u2265 3`, the lattice Eisenstein series `G_k(\u2124 \u03c4 + \u2124)` is holomorphic in `\u03c4`. -/\nlemma mdifferentiable_G_periodPair {k : \u2115} (hk : 3 \u2264 k) : MDiff fun \u03c4 : \u210d \u21a6 \u03c4.periodPair.G k := by\n simp only [fun \u03c4 : \u210d \u21a6 G_periodPair \u03c4 hk]\n exact mdifferentiable_const.mul (ModularFormClass.holo (E hk))\n\nopen scoped Manifold in\n/-- The lattice invariant `g\u2082(\u2124 \u03c4 + \u2124)` is holomorphic in `\u03c4`. -/\nlemma mdifferentiable_g\u2082_periodPair : MDiff fun \u03c4 : \u210d \u21a6 \u03c4.periodPair.g\u2082 := by\n simp only [PeriodPair.g\u2082]\n exact mdifferentiable_const.mul (mdifferentiable_G_periodPair (by norm_num))\n\nopen scoped Manifold in\n/-- The lattice invariant `g\u2083(\u2124 \u03c4 + \u2124)` is holomorphic in `\u03c4`. -/\nlemma mdifferentiable_g\u2083_periodPair : MDiff fun \u03c4 : \u210d \u21a6 \u03c4.periodPair.g\u2083 := by\n simp only [PeriodPair.g\u2083]\n exact mdifferentiable_const.mul (mdifferentiable_G_periodPair (by norm_num))\n\nend UpperHalfPlane\n\n/-! ### The Weierstrass curve of a period lattice -/\n\nnamespace PeriodPair\n\nvariable (L : PeriodPair)\n\n/-- The Weierstrass curve `y\u00b2 = x\u00b3 - (g\u2082 / 4) x - g\u2083 / 4` of a period lattice. The point\n`(\u2118(z), \u2118'(z) / 2)` lies on it for `z \u2209 \u039b` (`PeriodPair.equation_weierstrassP`). -/\ndef weierstrassCurve : WeierstrassCurve \u2102 where\n a\u2081 := 0\n a\u2082 := 0\n a\u2083 := 0\n a\u2084 := -(L.g\u2082 / 4)\n a\u2086 := -(L.g\u2083 / 4)\n\nlemma weierstrassCurve_a\u2081 : L.weierstrassCurve.a\u2081 = 0 := by unfold weierstrassCurve; rfl\nlemma weierstrassCurve_a\u2082 : L.weierstrassCurve.a\u2082 = 0 := by unfold weierstrassCurve; rfl\nlemma weierstrassCurve_a\u2083 : L.weierstrassCurve.a\u2083 = 0 := by unfold weierstrassCurve; rfl\n\n/-- The Weierstrass curve of a lattice is in short normal form. -/\ninstance isShortNF_weierstrassCurve : L.weierstrassCurve.IsShortNF :=\n \u27e8L.weierstrassCurve_a\u2081, L.weierstrassCurve_a\u2082, L.weierstrassCurve_a\u2083\u27e9\n\n@[simp] lemma weierstrassCurve_a\u2084 : L.weierstrassCurve.a\u2084 = -(L.g\u2082 / 4) := by\n unfold weierstrassCurve; rfl\n\n@[simp] lemma weierstrassCurve_a\u2086 : L.weierstrassCurve.a\u2086 = -(L.g\u2083 / 4) := by\n unfold weierstrassCurve; rfl\n\n/-- The discriminant of the Weierstrass curve of a lattice is `g\u2082\u00b3 - 27 g\u2083\u00b2`. -/\nlemma weierstrassCurve_\u0394 : L.weierstrassCurve.\u0394 = L.g\u2082 ^ 3 - 27 * L.g\u2083 ^ 2 := by\n simp only [WeierstrassCurve.\u0394, WeierstrassCurve.b\u2082, WeierstrassCurve.b\u2084, WeierstrassCurve.b\u2086,\n WeierstrassCurve.b\u2088, weierstrassCurve_a\u2081, weierstrassCurve_a\u2082, weierstrassCurve_a\u2083,\n weierstrassCurve_a\u2084, weierstrassCurve_a\u2086]\n ring\n\n/-- Rescaling the lattice by `c` changes its Weierstrass curve by the variable change\n`(x, y) \u21a6 (c\u207b\u00b2 x, c\u207b\u00b3 y)`, that is, with `u = c` and `r = s = t = 0`. -/\nlemma weierstrassCurve_smul (c : \u2102\u02e3) :\n (c \u2022 L).weierstrassCurve = (\u27e8c, 0, 0, 0\u27e9 : VariableChange \u2102) \u2022 L.weierstrassCurve := by\n ext <;> simp [variableChange_a\u2081, variableChange_a\u2082, variableChange_a\u2083, variableChange_a\u2084,\n variableChange_a\u2086, g\u2082_smul, g\u2083_smul] <;> ring\n\n/-- The Weierstrass curve depends only on the lattice, not on the chosen basis. -/\nlemma weierstrassCurve_eq_of_lattice_eq {L L' : PeriodPair} (h : L.lattice = L'.lattice) :\n L.weierstrassCurve = L'.weierstrassCurve := by\n ext <;> simp [g\u2082, g\u2083, G_eq_of_lattice_eq h]\n\nend PeriodPair\n\nnamespace UpperHalfPlane\n\n/-- The discriminant of the Weierstrass curve of `\u2124 \u03c4 + \u2124` is `(2 \u03c0)\u00b9\u00b2 \u0394(\u03c4)`. -/\nlemma weierstrassCurve_\u0394_periodPair (\u03c4 : \u210d) :\n \u03c4.periodPair.weierstrassCurve.\u0394 = (2 * \u03c0) ^ 12 * discriminant \u03c4 := by\n rw [PeriodPair.weierstrassCurve_\u0394, g\u2082_periodPair, g\u2083_periodPair,\n discriminant_eq_E\u2084_cube_sub_E\u2086_sq]\n ring\n\nend UpperHalfPlane\n\nnamespace PeriodPair\n\nvariable (L : PeriodPair)\n\n/-- **The discriminant `g\u2082\u00b3 - 27 g\u2083\u00b2` of a lattice does not vanish.** -/\nlemma weierstrassCurve_\u0394_ne_zero : L.weierstrassCurve.\u0394 \u2260 0 := by\n obtain \u27e8c, \u03c4, h\u27e9 := L.exists_lattice_eq_smul_periodPair\n rw [weierstrassCurve_eq_of_lattice_eq h, weierstrassCurve_smul, variableChange_\u0394,\n weierstrassCurve_\u0394_periodPair]\n exact mul_ne_zero (pow_ne_zero _ (Units.ne_zero _)) (mul_ne_zero (by simp [Real.pi_ne_zero])\n (discriminant_ne_zero \u03c4))\n\ninstance : L.weierstrassCurve.IsElliptic :=\n \u27e8L.weierstrassCurve_\u0394_ne_zero.isUnit\u27e9\n\n/-- The `j`-invariant of the Weierstrass curve of a lattice is `1728 g\u2082\u00b3 / (g\u2082\u00b3 - 27 g\u2083\u00b2)`. -/\nlemma weierstrassCurve_j :\n L.weierstrassCurve.j = 1728 * L.g\u2082 ^ 3 / (L.g\u2082 ^ 3 - 27 * L.g\u2083 ^ 2) := by\n rw [j_eq, weierstrassCurve_\u0394]\n simp only [c\u2084, b\u2082, b\u2084, weierstrassCurve_a\u2081, weierstrassCurve_a\u2082, weierstrassCurve_a\u2083,\n weierstrassCurve_a\u2084]\n ring\n\nvariable {L} in\n/-- The `j`-invariant of `E_\u039b` is `1728` exactly when `g\u2083(\u039b) = 0`. -/\nlemma weierstrassCurve_j_eq_1728_iff : L.weierstrassCurve.j = 1728 \u2194 L.g\u2083 = 0 := by\n rw [WeierstrassCurve.j_eq_1728_iff]\n norm_num [c\u2086, b\u2082, b\u2084, b\u2086]\n\nvariable {L} in\n/-- The `j`-invariant of `E_\u039b` is `0` exactly when `g\u2082(\u039b) = 0`. -/\nlemma weierstrassCurve_j_eq_zero_iff : L.weierstrassCurve.j = 0 \u2194 L.g\u2082 = 0 := by\n rw [WeierstrassCurve.j_eq_zero_iff]\n norm_num [c\u2084, b\u2082, b\u2084]\n\nend PeriodPair\n\nnamespace UpperHalfPlane\n\n/-- The `j`-invariant of the Weierstrass curve of `\u2124 \u03c4 + \u2124` is the modular invariant\n`j(\u03c4) = E\u2084(\u03c4)\u00b3 / \u0394(\u03c4)`. -/\nlemma weierstrassCurve_j_periodPair (\u03c4 : \u210d) :\n \u03c4.periodPair.weierstrassCurve.j = TauCeti.ModularForm.j \u03c4 := by\n rw [j_eq, weierstrassCurve_\u0394_periodPair, TauCeti.ModularForm.j_apply]\n simp only [c\u2084, b\u2082, b\u2084, PeriodPair.weierstrassCurve_a\u2081, PeriodPair.weierstrassCurve_a\u2082,\n PeriodPair.weierstrassCurve_a\u2083, PeriodPair.weierstrassCurve_a\u2084, g\u2082_periodPair]\n have h\u03c0 : (\u03c0 : \u2102) \u2260 0 := by simp [Real.pi_ne_zero]\n field_simp\n ring\n\nend UpperHalfPlane\n\n/-! ### The point `(\u2118(z), \u2118'(z) / 2)` -/\n\nnamespace PeriodPair\n\nvariable (L : PeriodPair) {z : \u2102}\n\n/-- For `z \u2209 \u039b` the point `(\u2118(z), \u2118'(z) / 2)` lies on the Weierstrass curve of `L`: this is the\ndifferential equation `\u2118'\u00b2 = 4 \u2118\u00b3 - g\u2082 \u2118 - g\u2083` divided by `4`. -/\nlemma equation_weierstrassP (hz : z \u2209 L.lattice) :\n L.weierstrassCurve.toAffine.Equation (\u2118[L] z) (\u2118'[L] z / 2) := by\n rw [Affine.equation_iff]\n simp only [weierstrassCurve_a\u2081, weierstrassCurve_a\u2082, weierstrassCurve_a\u2083, weierstrassCurve_a\u2084,\n weierstrassCurve_a\u2086]\n linear_combination L.derivWeierstrassP_sq z hz / 4\n\nlemma nonsingular_weierstrassP (hz : z \u2209 L.lattice) :\n L.weierstrassCurve.toAffine.Nonsingular (\u2118[L] z) (\u2118'[L] z / 2) :=\n Affine.equation_iff_nonsingular.mp (L.equation_weierstrassP hz)\n\nopen Classical in\n/-- The point `(\u2118(z), \u2118'(z) / 2)` of the Weierstrass curve of `L` for `z \u2209 \u039b`, and the point at\ninfinity `0` for `z \u2208 \u039b`. -/\ndef weierstrassPoint (z : \u2102) : L.weierstrassCurve.toAffine.Point :=\n if hz : z \u2208 L.lattice then 0 else .some _ _ (L.nonsingular_weierstrassP hz)\n\nlemma weierstrassPoint_of_mem (hz : z \u2208 L.lattice) : L.weierstrassPoint z = 0 := by\n simp [weierstrassPoint, hz]\n\nlemma weierstrassPoint_of_notMem (hz : z \u2209 L.lattice) :\n L.weierstrassPoint z = .some _ _ (L.nonsingular_weierstrassP hz) := by\n simp [weierstrassPoint, hz]\n\n@[simp]\nlemma weierstrassPoint_coe (l : L.lattice) : L.weierstrassPoint l = 0 :=\n L.weierstrassPoint_of_mem l.property\n\n@[simp]\nlemma weierstrassPoint_zero : L.weierstrassPoint 0 = 0 :=\n L.weierstrassPoint_of_mem (zero_mem _)\n\n/-- The point map vanishes exactly on the lattice. -/\n@[simp]\nlemma weierstrassPoint_eq_zero_iff : L.weierstrassPoint z = 0 \u2194 z \u2208 L.lattice := by\n refine \u27e8fun h \u21a6 by_contra fun hz \u21a6 ?_, L.weierstrassPoint_of_mem\u27e9\n rw [L.weierstrassPoint_of_notMem hz] at h\n exact Affine.Point.some_ne_zero _ h\n\nlemma weierstrassPoint_add_coe (z : \u2102) (l : L.lattice) :\n L.weierstrassPoint (z + l) = L.weierstrassPoint z := by\n by_cases hz : z \u2208 L.lattice\n \u00b7 rw [L.weierstrassPoint_of_mem hz, L.weierstrassPoint_of_mem (add_mem hz l.property)]\n \u00b7 have hzl : z + l \u2209 L.lattice := fun h \u21a6 hz (by simpa using sub_mem h l.property)\n rw [L.weierstrassPoint_of_notMem hz, L.weierstrassPoint_of_notMem hzl]\n simp [weierstrassP_add_coe, derivWeierstrassP_add_coe]\n\nlemma periodic_weierstrassPoint (l : L.lattice) : L.weierstrassPoint.Periodic l :=\n (L.weierstrassPoint_add_coe \u00b7 l)\n\n/-- The point map is odd: `-z` goes to `(\u2118(z), -\u2118'(z) / 2)`. -/\n@[simp]\nlemma weierstrassPoint_neg (z : \u2102) : L.weierstrassPoint (-z) = -L.weierstrassPoint z := by\n by_cases hz : z \u2208 L.lattice\n \u00b7 rw [L.weierstrassPoint_of_mem hz, L.weierstrassPoint_of_mem (neg_mem hz), Affine.Point.neg_zero]\n \u00b7 rw [L.weierstrassPoint_of_notMem hz, L.weierstrassPoint_of_notMem (by simpa using hz),\n Affine.Point.neg_some]\n simp [weierstrassP_neg, derivWeierstrassP_neg, Affine.negY, neg_div]\n\nend PeriodPair\n\n/-! ### The point map in the chart at infinity -/\n\nnamespace PeriodPair\n\nopen Filter Topology\n\nvariable (L : PeriodPair) {l\u2080 : \u2102}\n\n/-- The denominator `(z - l\u2080)\u00b3 \u2118'_{l\u2080}(z) - 2` of `PeriodPair.inv_derivWeierstrassP_eq` is\nholomorphic at `l\u2080`, where it takes the value `-2`. -/\nprivate lemma analyticAt_denominator (l\u2080 : \u2102) :\n AnalyticAt \u2102 (fun z \u21a6 (z - l\u2080) ^ 3 * \u2118'[L - l\u2080] z - 2) l\u2080 \u2227\n (l\u2080 - l\u2080) ^ 3 * \u2118'[L - l\u2080] l\u2080 - 2 \u2260 0 :=\n \u27e8by fun_prop, by simp\u27e9\n\n/-- Near a lattice point `l\u2080`, `1 / \u2118'` is a holomorphic function divided by a holomorphic function\nthat is `-2` at `l\u2080`. The identity holds everywhere, including the junk value `\u2118'(l\u2080)\u207b\u00b9 = 0`. -/\nlemma inv_derivWeierstrassP_eq (hl\u2080 : l\u2080 \u2208 L.lattice) (z : \u2102) :\n (\u2118'[L] z)\u207b\u00b9 = (z - l\u2080) ^ 3 / ((z - l\u2080) ^ 3 * \u2118'[L - l\u2080] z - 2) := by\n rcases eq_or_ne z l\u2080 with rfl | hz\n \u00b7 simp [L.derivWeierstrassP_coe \u27e8z, hl\u2080\u27e9]\n have h3 : (z - l\u2080) ^ 3 \u2260 0 := pow_ne_zero _ (sub_ne_zero.mpr hz)\n rw [L.derivWeierstrassPExcept_def \u27e8l\u2080, hl\u2080\u27e9, mul_add, mul_div_cancel\u2080 _ h3,\n add_sub_cancel_right, div_mul_cancel_left\u2080 h3]\n\n/-- Near a lattice point `l\u2080`, `\u2118 / \u2118'` is `z - l\u2080` times a quotient of holomorphic functions whose\nvalue at `l\u2080` is `1 / (-2)`. -/\nlemma weierstrassP_div_derivWeierstrassP_eq (hl\u2080 : l\u2080 \u2208 L.lattice) (z : \u2102) :\n \u2118[L] z / \u2118'[L] z = (z - l\u2080) * (((z - l\u2080) ^ 2 * (\u2118[L - l\u2080] z - 1 / l\u2080 ^ 2) + 1) /\n ((z - l\u2080) ^ 3 * \u2118'[L - l\u2080] z - 2)) := by\n rcases eq_or_ne z l\u2080 with rfl | hz\n \u00b7 simp [L.weierstrassP_coe \u27e8z, hl\u2080\u27e9]\n rw [div_eq_mul_inv, L.inv_derivWeierstrassP_eq hl\u2080, L.weierstrassPExcept_def \u27e8l\u2080, hl\u2080\u27e9]\n field_simp\n ring\n\n/-- The cofactor of `z - l\u2080` in `PeriodPair.weierstrassP_div_derivWeierstrassP_eq`. -/\nprivate lemma analyticAt_cofactor (l\u2080 : \u2102) :\n AnalyticAt \u2102 (fun z \u21a6 ((z - l\u2080) ^ 2 * (\u2118[L - l\u2080] z - 1 / l\u2080 ^ 2) + 1) /\n ((z - l\u2080) ^ 3 * \u2118'[L - l\u2080] z - 2)) l\u2080 :=\n (by fun_prop : AnalyticAt \u2102 (fun z \u21a6 (z - l\u2080) ^ 2 * (\u2118[L - l\u2080] z - 1 / l\u2080 ^ 2) + 1) l\u2080).div\n (L.analyticAt_denominator l\u2080).1 (L.analyticAt_denominator l\u2080).2\n\n/-- The coordinate `1 / \u2118'` of the chart at infinity is holomorphic on the domain of that chart:\nwhere `\u2118' \u2260 0`, and at the lattice points, where it vanishes. -/\nlemma analyticAt_inv_derivWeierstrassP {z\u2080 : \u2102} (h : \u2118'[L] z\u2080 \u2260 0 \u2228 z\u2080 \u2208 L.lattice) :\n AnalyticAt \u2102 (fun z \u21a6 (\u2118'[L] z)\u207b\u00b9) z\u2080 := by\n rcases h with h | hz\u2080\n \u00b7 exact (L.analyticOnNhd_derivWeierstrassP z\u2080 fun hz \u21a6 h (L.derivWeierstrassP_coe \u27e8z\u2080, hz\u27e9)).inv h\n \u00b7 simp_rw [L.inv_derivWeierstrassP_eq hz\u2080]\n exact (by fun_prop : AnalyticAt \u2102 (fun z \u21a6 (z - z\u2080) ^ 3) z\u2080).div\n (L.analyticAt_denominator z\u2080).1 (L.analyticAt_denominator z\u2080).2\n\n/-- The coordinate `\u2118 / \u2118'` of the chart at infinity is holomorphic on the domain of that chart:\nwhere `\u2118' \u2260 0`, and at the lattice points, where it vanishes. -/\nlemma analyticAt_weierstrassP_div_derivWeierstrassP {z\u2080 : \u2102}\n (h : \u2118'[L] z\u2080 \u2260 0 \u2228 z\u2080 \u2208 L.lattice) :\n AnalyticAt \u2102 (fun z \u21a6 \u2118[L] z / \u2118'[L] z) z\u2080 := by\n rcases h with h | hz\u2080\n \u00b7 have hz\u2080 : z\u2080 \u2209 L.lattice := fun hz \u21a6 h (L.derivWeierstrassP_coe \u27e8z\u2080, hz\u27e9)\n exact (L.analyticOnNhd_weierstrassP z\u2080 hz\u2080).div (L.analyticOnNhd_derivWeierstrassP z\u2080 hz\u2080) h\n \u00b7 simp_rw [L.weierstrassP_div_derivWeierstrassP_eq hz\u2080]\n exact (by fun_prop : AnalyticAt \u2102 (fun z \u21a6 z - z\u2080) z\u2080).mul (L.analyticAt_cofactor z\u2080)\n\n/-- At a lattice point, `\u2118 / \u2118'` has derivative `-1 / 2`: the coordinate `-x / y = -2 \u2118 / \u2118'` is a\nlocal parameter of the curve at the point at infinity. -/\nlemma hasDerivAt_weierstrassP_div_derivWeierstrassP (hl\u2080 : l\u2080 \u2208 L.lattice) :\n HasDerivAt (fun z \u21a6 \u2118[L] z / \u2118'[L] z) (-1 / 2) l\u2080 := by\n simp_rw [L.weierstrassP_div_derivWeierstrassP_eq hl\u2080]\n convert ((hasDerivAt_id' l\u2080).sub_const l\u2080).mul\n (L.analyticAt_cofactor l\u2080).differentiableAt.hasDerivAt using 1\n norm_num\n\n/-- `\u2118'` has no zeros in a punctured neighbourhood of a lattice point. -/\nlemma eventually_derivWeierstrassP_ne_zero (hl\u2080 : l\u2080 \u2208 L.lattice) :\n \u2200\u1da0 z in \ud835\udcdd[\u2260] l\u2080, \u2118'[L] z \u2260 0 := by\n have h := (L.analyticAt_denominator l\u2080).1.continuousAt.eventually_ne\n (L.analyticAt_denominator l\u2080).2\n filter_upwards [nhdsWithin_le_nhds h, self_mem_nhdsWithin] with z hz (hzl : z \u2260 l\u2080) h0\n have := L.inv_derivWeierstrassP_eq hl\u2080 z\n rw [h0, inv_zero, eq_comm, div_eq_zero_iff] at this\n exact this.elim (fun h \u21a6 sub_ne_zero.mpr hzl (pow_eq_zero_iff three_ne_zero |>.mp h)) hz\n\n/-- Off the lattice, the projective coordinates `[\u2118 : \u2118' / 2 : 1]` of the point map in the affine\nchart are nonsingular and represent the point map. -/\nprivate lemma nonsingular_toAffine_affineChart {z : \u2102} (hz : z \u2209 L.lattice) :\n L.weierstrassCurve.toProjective.Nonsingular ![\u2118[L] z, \u2118'[L] z / 2, 1] \u2227\n Projective.Point.toAffine L.weierstrassCurve.toProjective ![\u2118[L] z, \u2118'[L] z / 2, 1] =\n L.weierstrassPoint z := by\n have hn : L.weierstrassCurve.toProjective.Nonsingular ![\u2118[L] z, \u2118'[L] z / 2, 1] :=\n (Projective.nonsingular_some _ _).mpr (L.nonsingular_weierstrassP hz)\n rw [Projective.Point.toAffine_some hn, L.weierstrassPoint_of_notMem hz]\n exact \u27e8hn, rfl\u27e9\n\n/-- The projective coordinates `[2 \u2118 / \u2118' : 1 : 2 / \u2118']` of the point map in the chart at\ninfinity are nonsingular and represent the point map on the domain of that chart. -/\nprivate lemma nonsingular_toAffine_chartAtInfinity {z : \u2102} (h : \u2118'[L] z \u2260 0 \u2228 z \u2208 L.lattice) :\n L.weierstrassCurve.toProjective.Nonsingular\n ![2 * (\u2118[L] z / \u2118'[L] z), 1, 2 * (\u2118'[L] z)\u207b\u00b9] \u2227\n Projective.Point.toAffine L.weierstrassCurve.toProjective\n ![2 * (\u2118[L] z / \u2118'[L] z), 1, 2 * (\u2118'[L] z)\u207b\u00b9] = L.weierstrassPoint z := by\n rcases h with h | hz\n \u00b7 have hz : z \u2209 L.lattice := fun hz \u21a6 h (L.derivWeierstrassP_coe \u27e8z, hz\u27e9)\n have hu : IsUnit (2 * (\u2118'[L] z)\u207b\u00b9) := by simp [h]\n have he : ![2 * (\u2118[L] z / \u2118'[L] z), 1, 2 * (\u2118'[L] z)\u207b\u00b9] =\n (2 * (\u2118'[L] z)\u207b\u00b9) \u2022 ![\u2118[L] z, \u2118'[L] z / 2, 1] := by\n ext i\n fin_cases i <;>\n simp only [Fin.zero_eta, Fin.mk_one, Fin.reduceFinMk, Matrix.cons_val_zero,\n Matrix.cons_val_one, Matrix.cons_val, Pi.smul_apply, smul_eq_mul] <;> field_simp\n rw [he, Projective.nonsingular_smul _ hu, Projective.Point.toAffine_smul _ hu]\n exact L.nonsingular_toAffine_affineChart hz\n \u00b7 have he : ![2 * (\u2118[L] z / \u2118'[L] z), 1, 2 * (\u2118'[L] z)\u207b\u00b9] = ![0, 1, 0] := by\n simp [L.weierstrassP_coe \u27e8z, hz\u27e9, L.derivWeierstrassP_coe \u27e8z, hz\u27e9]\n rw [he, Projective.Point.toAffine_zero, L.weierstrassPoint_of_mem hz]\n exact \u27e8Projective.nonsingular_zero, rfl\u27e9\n\n/-- Near a lattice point `l\u2080`, the projective coordinates `[2 \u2118 / \u2118' : 1 : 2 / \u2118']` of the point\nmap in the chart at infinity are nonsingular and represent the point map. -/\nlemma eventually_nonsingular_toAffine_chartAtInfinity (hl\u2080 : l\u2080 \u2208 L.lattice) :\n \u2200\u1da0 z in \ud835\udcdd l\u2080, L.weierstrassCurve.toProjective.Nonsingular\n ![2 * (\u2118[L] z / \u2118'[L] z), 1, 2 * (\u2118'[L] z)\u207b\u00b9] \u2227\n Projective.Point.toAffine L.weierstrassCurve.toProjective\n ![2 * (\u2118[L] z / \u2118'[L] z), 1, 2 * (\u2118'[L] z)\u207b\u00b9] = L.weierstrassPoint z := by\n filter_upwards [eventually_nhdsWithin_iff.mp (L.eventually_derivWeierstrassP_ne_zero hl\u2080)]\n with z hz\n refine L.nonsingular_toAffine_chartAtInfinity ?_\n rcases eq_or_ne z l\u2080 with rfl | hne\n \u00b7 exact .inr hl\u2080\n \u00b7 exact .inl (hz hne)\n\n/-- A triple of functions holomorphic at `z\u2080` is holomorphic at `z\u2080` as a map to `Fin 3 \u2192 \u2102`. -/\nprivate lemma analyticAt_vecCons\u2083 {f g h : \u2102 \u2192 \u2102} {z\u2080 : \u2102} (hf : AnalyticAt \u2102 f z\u2080)\n (hg : AnalyticAt \u2102 g z\u2080) (hh : AnalyticAt \u2102 h z\u2080) :\n AnalyticAt \u2102 (fun z \u21a6 ![f z, g z, h z]) z\u2080 := by\n rw [analyticAt_pi_iff]\n intro i\n fin_cases i <;>\n simp only [Fin.zero_eta, Fin.mk_one, Fin.reduceFinMk, Matrix.cons_val_zero,\n Matrix.cons_val_one, Matrix.cons_val] <;> assumption\n\n/-- **The point map is holomorphic.** Near every `z\u2080 \u2208 \u2102`, the point `(\u2118(z), \u2118'(z) / 2)` (the\npoint at infinity for `z \u2208 \u039b`) has a holomorphic lift to nonsingular projective coordinates: the\nlift `[\u2118 : \u2118' / 2 : 1]` off the lattice and `[2 \u2118 / \u2118' : 1 : 2 / \u2118']` near the lattice. -/\ntheorem exists_analyticAt_toAffine_eq_weierstrassPoint (z\u2080 : \u2102) :\n \u2203 P : \u2102 \u2192 Fin 3 \u2192 \u2102, AnalyticAt \u2102 P z\u2080 \u2227 \u2200\u1da0 z in \ud835\udcdd z\u2080,\n L.weierstrassCurve.toProjective.Nonsingular (P z) \u2227\n Projective.Point.toAffine L.weierstrassCurve.toProjective (P z) = L.weierstrassPoint z := by\n by_cases hz\u2080 : z\u2080 \u2208 L.lattice\n \u00b7 refine \u27e8fun z \u21a6 ![2 * (\u2118[L] z / \u2118'[L] z), 1, 2 * (\u2118'[L] z)\u207b\u00b9], ?_, ?_\u27e9\n \u00b7 exact analyticAt_vecCons\u2083\n (analyticAt_const.mul (L.analyticAt_weierstrassP_div_derivWeierstrassP (.inr hz\u2080)))\n analyticAt_const (analyticAt_const.mul (L.analyticAt_inv_derivWeierstrassP (.inr hz\u2080)))\n \u00b7 exact L.eventually_nonsingular_toAffine_chartAtInfinity hz\u2080\n \u00b7 refine \u27e8fun z \u21a6 ![\u2118[L] z, \u2118'[L] z / 2, 1], ?_, ?_\u27e9\n \u00b7 exact analyticAt_vecCons\u2083 (L.analyticOnNhd_weierstrassP z\u2080 hz\u2080)\n ((L.analyticOnNhd_derivWeierstrassP z\u2080 hz\u2080).div_const) analyticAt_const\n \u00b7 filter_upwards [L.isClosed_lattice.isOpen_compl.mem_nhds hz\u2080] with z hz\n exact L.nonsingular_toAffine_affineChart hz\n\n/-- The coordinate `\u2118 / \u2118'` of the chart at infinity is a function of the point\n`(\u2118(z), \u2118'(z) / 2)`. -/\nlemma weierstrassP_div_derivWeierstrassP_eq_of_weierstrassPoint_eq {z w : \u2102}\n (h : L.weierstrassPoint z = L.weierstrassPoint w) :\n \u2118[L] z / \u2118'[L] z = \u2118[L] w / \u2118'[L] w := by\n by_cases hz : z \u2208 L.lattice\n \u00b7 have hw : w \u2208 L.lattice := by\n rwa [\u2190 L.weierstrassPoint_eq_zero_iff, \u2190 h, L.weierstrassPoint_eq_zero_iff]\n simp [L.weierstrassP_coe \u27e8z, hz\u27e9, L.weierstrassP_coe \u27e8w, hw\u27e9]\n \u00b7 have hw : w \u2209 L.lattice := by\n rwa [\u2190 L.weierstrassPoint_eq_zero_iff, \u2190 h, L.weierstrassPoint_eq_zero_iff]\n rw [L.weierstrassPoint_of_notMem hz, L.weierstrassPoint_of_notMem hw,\n Affine.Point.some.injEq] at h\n rw [h.1, (div_left_inj\u2080 two_ne_zero).mp h.2]\n\n/-- The point map is injective near every lattice point, since the local parameter `\u2118 / \u2118'` at\nthe point at infinity has nonzero derivative there. -/\ntheorem exists_mem_nhds_injOn_weierstrassPoint (hl\u2080 : l\u2080 \u2208 L.lattice) :\n \u2203 U \u2208 \ud835\udcdd l\u2080, Set.InjOn L.weierstrassPoint U := by\n have h := (L.analyticAt_weierstrassP_div_derivWeierstrassP (.inr hl\u2080)).hasStrictDerivAt\n rw [(L.hasDerivAt_weierstrassP_div_derivWeierstrassP hl\u2080).deriv] at h\n obtain \u27e8U, hU, hinv\u27e9 := (h.eventually_left_inverse (by norm_num)).exists_mem\n refine \u27e8U, hU, fun z hz w hw hzw \u21a6 ?_\u27e9\n rw [\u2190 hinv z hz, \u2190 hinv w hw,\n L.weierstrassP_div_derivWeierstrassP_eq_of_weierstrassPoint_eq hzw]\n\nend PeriodPair\n\n/-! ### Surjectivity of the point map -/\n\nnamespace PeriodPair\n\nvariable (L : PeriodPair)\n\n/-- Near a lattice point `l\u2080`, `1 / (\u2118 - x)` is `(z - l\u2080)\u00b2` divided by a function that is\nholomorphic at `l\u2080` with value `1` there. -/\nprivate lemma inv_weierstrassP_sub_eq (x : \u2102) {l\u2080 z : \u2102} (hl\u2080 : l\u2080 \u2208 L.lattice) (hz : z \u2260 l\u2080) :\n (\u2118[L] z - x)\u207b\u00b9 = (z - l\u2080) ^ 2 / ((z - l\u2080) ^ 2 * (\u2118[L - l\u2080] z - 1 / l\u2080 ^ 2 - x) + 1) := by\n have h2 : (z - l\u2080) ^ 2 \u2260 0 := pow_ne_zero _ (sub_ne_zero.mpr hz)\n rw [L.weierstrassPExcept_def \u27e8l\u2080, hl\u2080\u27e9,\n show (z - l\u2080) ^ 2 * (\u2118[L] z + (1 / l\u2080 ^ 2 - 1 / (z - l\u2080) ^ 2) - 1 / l\u2080 ^ 2 - x) + 1 =\n (z - l\u2080) ^ 2 * (\u2118[L] z - x) by field_simp; ring,\n div_mul_cancel_left\u2080 h2]\n\n/-- **`\u2118` takes every complex value.** For every `x : \u2102` there is `z \u2209 \u039b` with `\u2118(z) = x`. -/\ntheorem exists_weierstrassP_eq (x : \u2102) : \u2203 z \u2209 L.lattice, \u2118[L] z = x := by\n classical\n by_contra! h\n let f : \u2102 \u2192 \u2102 := fun z \u21a6 if z \u2208 L.lattice then 0 else (\u2118[L] z - x)\u207b\u00b9\n have hdiff : Differentiable \u2102 f := by\n intro z\u2080\n by_cases hz\u2080 : z\u2080 \u2208 L.lattice\n \u00b7 -- Near `z\u2080`, `f` is `(z - z\u2080)\u00b2` divided by a function with value `1` at `z\u2080`.\n have hg : AnalyticAt \u2102 (fun z \u21a6 (z - z\u2080) ^ 2 * (\u2118[L - z\u2080] z - 1 / z\u2080 ^ 2 - x) + 1) z\u2080 := by\n have := L.analyticAt_weierstrassPExcept z\u2080\n fun_prop\n refine (((by fun_prop : AnalyticAt \u2102 (fun z \u21a6 (z - z\u2080) ^ 2) z\u2080).div hg\n (by simp)).differentiableAt).congr_of_eventuallyEq ?_\n filter_upwards [L.compl_lattice_sdiff_singleton_mem_nhds z\u2080] with z hz\n rcases eq_or_ne z z\u2080 with rfl | hzz\n \u00b7 simp [f, hz\u2080]\n \u00b7 have hzl : z \u2209 L.lattice := fun h \u21a6 hz \u27e8h, hzz\u27e9\n simp only [f, hzl, \u2193reduceIte]\n exact L.inv_weierstrassP_sub_eq x hz\u2080 hzz\n \u00b7 refine (((L.analyticOnNhd_weierstrassP z\u2080 hz\u2080).sub analyticAt_const).inv\n (sub_ne_zero.mpr (h z\u2080 hz\u2080))).differentiableAt.congr_of_eventuallyEq ?_\n filter_upwards [L.isClosed_lattice.isOpen_compl.mem_nhds hz\u2080] with z hz\n simp [f, show z \u2209 L.lattice from hz]\n have hper : \u2200 z w, w \u2208 L.lattice \u2192 f (z + w) = f z := fun z w hw \u21a6 by\n lift w to L.lattice using hw\n simp [f, L.lattice.add_mem_iff_left w.property, weierstrassP_add_coe]\n have h0 := hdiff.apply_eq_apply_of_bounded\n (IsZLattice.isCompact_range_of_periodic L.lattice f hdiff.continuous hper).isBounded\n (L.\u03c9\u2081 / 2) 0\n simp only [f, L.\u03c9\u2081_div_two_notMem_lattice, zero_mem, \u2193reduceIte] at h0\n exact inv_ne_zero (sub_ne_zero.mpr (h _ L.\u03c9\u2081_div_two_notMem_lattice)) h0\n\n/-- **The point map is surjective**: every point of the Weierstrass curve of `L` is the point at\ninfinity or `(\u2118(z), \u2118'(z) / 2)` for some `z \u2209 \u039b`. -/\ntheorem weierstrassPoint_surjective : Function.Surjective L.weierstrassPoint := by\n rintro (_ | \u27e8x, y, h\u27e9)\n \u00b7 exact \u27e80, L.weierstrassPoint_zero\u27e9\n obtain \u27e8z, hz, rfl\u27e9 := L.exists_weierstrassP_eq x\n have hy : y ^ 2 = (\u2118'[L] z / 2) ^ 2 := by\n have h\u2081 := (Affine.equation_iff ..).mp h.1\n have h\u2082 := (Affine.equation_iff ..).mp (L.equation_weierstrassP hz)\n simp only [weierstrassCurve_a\u2081, weierstrassCurve_a\u2082, weierstrassCurve_a\u2083] at h\u2081 h\u2082\n linear_combination h\u2081 - h\u2082\n rcases sq_eq_sq_iff_eq_or_eq_neg.mp hy with rfl | rfl\n \u00b7 exact \u27e8z, L.weierstrassPoint_of_notMem hz\u27e9\n \u00b7 refine \u27e8-z, ?_\u27e9\n rw [weierstrassPoint_neg, L.weierstrassPoint_of_notMem hz, Affine.Point.neg_some]\n simp [Affine.negY]\n\nend PeriodPair\n\n/-! ### Homothetic lattices -/\n\nnamespace PeriodPair\n\nvariable {L L' : PeriodPair} {c : \u2102\u02e3}\n\n/-- If `\u039b' = c \u039b`, the curve of `\u039b'` is obtained from that of `\u039b` by the change of variables\n`(x, y) \u21a6 (c\u207b\u00b2 x, c\u207b\u00b3 y)`, that is, with `u = c` and `r = s = t = 0`. -/\nlemma weierstrassCurve_eq_smul_of_lattice_eq (h : L'.lattice = (c \u2022 L).lattice) :\n L'.weierstrassCurve = (\u27e8c, 0, 0, 0\u27e9 : VariableChange \u2102) \u2022 L.weierstrassCurve := by\n rw [weierstrassCurve_eq_of_lattice_eq h, weierstrassCurve_smul]\n\n/-- Homothetic lattices have the same `j`-invariant. -/\nlemma weierstrassCurve_j_eq_of_lattice_eq_smul (h : L'.lattice = (c \u2022 L).lattice) :\n L'.weierstrassCurve.j = L.weierstrassCurve.j := by\n simp only [weierstrassCurve_eq_smul_of_lattice_eq h, variableChange_j]\n\n/-- For `\u039b' = c \u039b`, the isomorphism `E_{\u039b'}(\u2102) \u2243+ E_\u039b(\u2102)` given by the change of variables\n`(x, y) \u21a6 (c\u00b2 x, c\u00b3 y)`. It sends the point of `c z` to the point of `z`\n(`PeriodPair.pointAddEquivOfLatticeEq_weierstrassPoint`). -/\ndef pointAddEquivOfLatticeEq (h : L'.lattice = (c \u2022 L).lattice) :\n L'.weierstrassCurve.toAffine.Point \u2243+ L.weierstrassCurve.toAffine.Point :=\n (AddEquiv.cast (M := fun V : WeierstrassCurve \u2102 \u21a6 V.toAffine.Point)\n (weierstrassCurve_eq_smul_of_lattice_eq h)).trans\n (Affine.Point.addEquivVariableChange L.weierstrassCurve _)\n\n/-- On affine points, `PeriodPair.pointAddEquivOfLatticeEq` is `(x, y) \u21a6 (c\u00b2 x, c\u00b3 y)`. -/\nlemma pointAddEquivOfLatticeEq_some (h : L'.lattice = (c \u2022 L).lattice) {x y x' y' : \u2102}\n (hxy : L'.weierstrassCurve.toAffine.Nonsingular x y)\n (hxy' : L.weierstrassCurve.toAffine.Nonsingular x' y') (hx : x' = c ^ 2 * x)\n (hy : y' = c ^ 3 * y) :\n pointAddEquivOfLatticeEq h (.some x y hxy) = .some x' y' hxy' := by\n simp [pointAddEquivOfLatticeEq, Affine.Point.cast_some (weierstrassCurve_eq_smul_of_lattice_eq h),\n hx, hy]\n\n", "statement": "/-- **Rescaling naturality of the point map.** If `\u039b' = c \u039b`, the change of variables from `E_{\u039b'}`\nto `E_\u039b` sends the point `(\u2118(c z; \u039b'), \u2118'(c z; \u039b') / 2)` to `(\u2118(z; \u039b), \u2118'(z; \u039b) / 2)`. -/\n@[simp]\ntheorem pointAddEquivOfLatticeEq_weierstrassPoint (h : L'.lattice = (c \u2022 L).lattice) (z : \u2102) :\n pointAddEquivOfLatticeEq h (L'.weierstrassPoint (c * z)) = L.weierstrassPoint z ", "proof": " by\n have hmem : (c : \u2102) * z \u2208 L'.lattice \u2194 z \u2208 L.lattice := by\n rw [h, mul_mem_lattice_smul_iff]\n by_cases hz : z \u2208 L.lattice\n \u00b7 rw [L'.weierstrassPoint_of_mem (hmem.mpr hz), L.weierstrassPoint_of_mem hz, map_zero]\n rw [L'.weierstrassPoint_of_notMem (mt hmem.mp hz), L.weierstrassPoint_of_notMem hz]\n have hc : (c : \u2102) \u2260 0 := c.ne_zero\n refine pointAddEquivOfLatticeEq_some h _ _ ?_ ?_\n \u00b7 rw [weierstrassP_eq_of_lattice_eq h, weierstrassP_smul]\n field_simp\n \u00b7 rw [derivWeierstrassP_eq_of_lattice_eq h, derivWeierstrassP_smul]\n field_simp", "proof_lines": 11, "proof_length": 526, "rev": "75c8aed5fea63047615a25a9763fd5b68a86e891", "heartbeats": 1411, "image": "lean-compression:tauceti-75c8aed5fe-a608030cfc", "split": "dev"} {"path": "TauCeti/NumberTheory/NewtonPolygon/GaussNorm.lean", "module": "TauCeti.NumberTheory.NewtonPolygon.GaussNorm", "theorem": "Polynomial.forall_mem_newtonSlopes_eq_iff_norm_coeff_mul_rpow_pow_le", "prefix": "/-\nCopyright (c) 2026 The Tau Ceti contributors. All rights reserved.\nReleased under Apache 2.0 license as described in the file LICENSE.\nAuthors: The Tau Ceti contributors\n-/\nmodule\n\npublic import Mathlib.Analysis.SpecialFunctions.Log.Base\npublic import TauCeti.Analysis.Convex.Sequence.Face\npublic import TauCeti.NumberTheory.NewtonPolygon.Slopes\npublic import TauCeti.RingTheory.PowerSeries.GaussNorm\n\n/-!\n# Gauss norms and Newton supporting values\n\nFix a real additive valuation `v` on a normed division ring and a base `b > 1` with\n`\u2016x\u2016 = b ^ (-(v x).untop\u2080)` for nonzero `x`. At the radius `b ^ \u03c3` the weighted coefficient\nnorm `\u2016a\u2099\u2016 (b ^ \u03c3) ^ n` is `b ^ (-(v a\u2099 - \u03c3 n))`, the exponential of the negated tilted\ncoefficient height. Consequently an upper bound `b ^ (-c)` on all weighted coefficient norms is\nexactly an affine line of slope `\u03c3` and intercept `c` supporting the coefficient heights, and\na weighted coefficient norm equals `b ^ (-c)` exactly when the coefficient lies on that line.\n\nThis identifies the analytic Gauss norm with the convex supporting-line description:\n\n* the weighted coefficient norms are bounded exactly when the supporting value at `\u03c3` is above\n negative infinity, and coefficient heights are admissible exactly when the series is\n restricted at some positive radius;\n* for a nonzero series with bounded weighted coefficient norms, the supporting value of its\n coefficient heights, and of its Newton polygon, is `-Real.logb b` of its Gauss norm;\n* the coefficients attaining the Gauss norm are exactly the contact points of the supporting\n line of slope `\u03c3`, so the last and the first of them, `TauCeti.PowerSeries.IsDistinguished`\n and `TauCeti.PowerSeries.IsLowestDominant`, are the greatest and least contact indices.\n\nNeither attainment nor restrictedness at the given radius is assumed: at the boundary of\nconvergence the Gauss norm is still the supporting value, while it need not be attained.\nFor polynomials the identities hold at every radius, and the purity criterion\n`Polynomial.forall_mem_newtonSlopes_eq_iff` becomes a statement about weighted norms: every\nfinite slope equals `m` exactly when, at the radius `b ^ m`, the weighted leading and trailing\nterms have equal norms and bound all other weighted terms. The norm and valuation are compared by\nan explicit hypothesis, so no normalisation is hidden in a typeclass instance.\n\n## Main results\n\n* `PowerSeries.isSupportingLine_addValuation_coeff_iff`: affine minorants of the coefficient\n heights are exponential bounds on the weighted coefficient norms.\n* `PowerSeries.hasGaussNorm_iff_supportingValue_ne_bot`: bounded weighted coefficient norms\n correspond to a supporting value above negative infinity.\n* `PowerSeries.isAdmissible_addValuation_coeff_iff_exists_isRestricted`: coefficient heights\n are admissible exactly when the series is restricted at some positive radius.\n* `PowerSeries.supportingValue_newtonPolygon_eq_neg_logb_gaussNorm`: the supporting value of\n the Newton polygon is the negative logarithm of the Gauss norm, with the polynomial case\n `Polynomial.supportingValue_newtonPolygon_eq_neg_logb_gaussNorm` at every radius.\n* `Polynomial.forall_mem_newtonSlopes_eq_iff_norm_coeff_mul_rpow_pow_le`: the purity criterion\n in terms of weighted coefficient norms at the radius `b ^ m`.\n* `PowerSeries.mem_supportingFace_addValuation_coeff_iff`: the contact indices of the\n supporting line are the indices attaining the Gauss norm.\n* `PowerSeries.isDistinguished_iff_isGreatest_supportingFace` and\n `PowerSeries.isLowestDominant_iff_isLeast_supportingFace`: the last and the first coefficient\n attaining the Gauss norm are the greatest and least contact indices.\n* `PowerSeries.exists_isSupportingLine_mem_supportingFace_of_isRestricted`: the coefficient\n heights of a nonzero series restricted at `b ^ \u03c3` touch a supporting line of slope `\u03c3`.\n\n## References\n\n* N. Koblitz, *p-adic Numbers, p-adic Analysis, and Zeta-Functions*, second edition,\n Graduate Texts in Mathematics 58, Springer, 1984, Chapter IV \u00a7\u00a73\u20134.\n* M. Lazard, *Les z\u00e9ros d'une fonction analytique d'une variable sur un corps valu\u00e9 complet*,\n Publications Math\u00e9matiques de l'IH\u00c9S 14 (1962), \u00a71. Lazard's variable is a valuation\n threshold, corresponding to `-\u03c3` here.\n-/\n\npublic section\n\nopen TauCeti\n\nnamespace PowerSeries\n\nvariable {K : Type*} [NormedDivisionRing K] (f : PowerSeries K)\n (v : AddValuation K (WithTop \u211d)) {b : \u211d} (hb : 1 < b)\n (hv : \u2200 x \u2260 0, \u2016x\u2016 = b ^ (-(v x).untop\u2080))\n\ninclude hb hv\n\n/-- At a nonzero coefficient, the weighted norm is the exponential of the negated tilted\ncoefficient height. -/\ntheorem norm_coeff_mul_rpow_pow_eq {n : \u2115} (hn : f.coeff n \u2260 0) (\u03c3 : \u211d) :\n \u2016f.coeff n\u2016 * (b ^ \u03c3) ^ n = b ^ (-((v (f.coeff n)).untop\u2080 - \u03c3 * n)) := by\n have hb0 : 0 < b := zero_lt_one.trans hb\n rw [hv _ hn, \u2190 Real.rpow_mul_natCast hb0.le, \u2190 Real.rpow_add hb0]\n ring_nf\n\n/-- An exponential upper bound on one weighted coefficient norm is an affine lower bound on\nthe height of that coefficient. A zero coefficient satisfies both bounds. -/\ntheorem norm_coeff_mul_rpow_pow_le_iff (n : \u2115) (\u03c3 c : \u211d) :\n \u2016f.coeff n\u2016 * (b ^ \u03c3) ^ n \u2264 b ^ (-c) \u2194\n ((c + \u03c3 * n : \u211d) : WithTop \u211d) \u2264 v (f.coeff n) := by\n by_cases hn : f.coeff n = 0\n \u00b7 simp [hn, (Real.rpow_pos_of_pos (zero_lt_one.trans hb) (-c)).le]\n rw [norm_coeff_mul_rpow_pow_eq f v hb hv hn, Real.rpow_le_rpow_left_iff hb,\n \u2190 WithTop.coe_untop\u2080_of_ne_top ((v.ne_top_iff).mpr hn), WithTop.coe_le_coe,\n WithTop.untop\u2080_coe]\n constructor <;> intro h <;> linarith\n\n/-- An upper bound `b ^ (-c)` on one coefficient norm is the lower bound `c` on the height of that\ncoefficient. A zero coefficient satisfies both bounds. -/\ntheorem norm_coeff_le_rpow_neg_iff (n : \u2115) (c : \u211d) :\n \u2016f.coeff n\u2016 \u2264 b ^ (-c) \u2194 (c : WithTop \u211d) \u2264 v (f.coeff n) := by\n simpa using norm_coeff_mul_rpow_pow_le_iff f v hb hv n 0 c\n\n/-- A weighted coefficient norm equals `b ^ (-c)` exactly when the coefficient lies on the line\nof slope `\u03c3` and intercept `c`. A zero coefficient satisfies neither condition. -/\ntheorem norm_coeff_mul_rpow_pow_eq_iff (n : \u2115) (\u03c3 c : \u211d) :\n \u2016f.coeff n\u2016 * (b ^ \u03c3) ^ n = b ^ (-c) \u2194\n v (f.coeff n) = ((c + \u03c3 * n : \u211d) : WithTop \u211d) := by\n by_cases hn : f.coeff n = 0\n \u00b7 simp only [hn, norm_zero, zero_mul, AddValuation.map_zero, WithTop.top_ne_coe, iff_false]\n exact (Real.rpow_pos_of_pos (zero_lt_one.trans hb) (-c)).ne\n rw [norm_coeff_mul_rpow_pow_eq f v hb hv hn,\n Real.rpow_right_inj (zero_lt_one.trans hb) hb.ne',\n \u2190 WithTop.coe_untop\u2080_of_ne_top ((v.ne_top_iff).mpr hn), WithTop.coe_eq_coe,\n WithTop.untop\u2080_coe]\n constructor <;> intro h <;> linarith\n\n/-- A line of slope `\u03c3` and intercept `c` supports the coefficient heights exactly when\n`b ^ (-c)` bounds every weighted coefficient norm at the radius `b ^ \u03c3`. No boundedness\nassumption is needed. -/\ntheorem isSupportingLine_addValuation_coeff_iff (\u03c3 c : \u211d) :\n IsSupportingLine (fun n => v (f.coeff n)) \u03c3 c \u2194\n \u2200 n, \u2016f.coeff n\u2016 * (b ^ \u03c3) ^ n \u2264 b ^ (-c) :=\n isSupportingLine_iff_forall.trans\n (forall_congr' fun n => (norm_coeff_mul_rpow_pow_le_iff f v hb hv n \u03c3 c).symm)\n\n/-- Bounded weighted coefficient norms are equivalent to a supporting value above negative\ninfinity, including for the zero series. This is weaker than restrictedness. -/\ntheorem hasGaussNorm_iff_supportingValue_ne_bot (\u03c3 : \u211d) :\n f.HasGaussNorm norm (b ^ \u03c3) \u2194 supportingValue (fun n => v (f.coeff n)) \u03c3 \u2260 \u22a5 := by\n constructor\n \u00b7 rintro \u27e8B, hB\u27e9\n have hB1 : 0 < max B 1 := zero_lt_one.trans_le (le_max_right _ _)\n refine ne_bot_of_le_ne_bot (EReal.coe_ne_bot (-Real.logb b (max B 1)))\n (isSupportingLine_iff.mp ((isSupportingLine_addValuation_coeff_iff f v hb hv \u03c3 _).mpr\n fun n => ?_))\n rw [neg_neg, Real.rpow_logb (zero_lt_one.trans hb) hb.ne' hB1]\n exact (hB \u27e8n, rfl\u27e9).trans (le_max_left _ _)\n \u00b7 intro h\n obtain \u27e8c, hc\u27e9 := supportingValue_ne_bot_iff.mp h\n exact \u27e8b ^ (-c), by\n rintro _ \u27e8n, rfl\u27e9\n exact (norm_coeff_mul_rpow_pow_le_iff f v hb hv n \u03c3 c).mpr (hc n)\u27e9\n\n/-- For bounded weighted coefficient norms, a line of slope `\u03c3` and intercept `c` supports the\ncoefficient heights exactly when `b ^ (-c)` bounds the Gauss norm at the radius `b ^ \u03c3`. -/\ntheorem isSupportingLine_addValuation_coeff_iff_gaussNorm_le {\u03c3 : \u211d}\n (hf : f.HasGaussNorm norm (b ^ \u03c3)) (c : \u211d) :\n IsSupportingLine (fun n => v (f.coeff n)) \u03c3 c \u2194 f.gaussNorm norm (b ^ \u03c3) \u2264 b ^ (-c) := by\n rw [isSupportingLine_addValuation_coeff_iff f v hb hv, gaussNorm_eq, ciSup_le_iff hf]\n\n/-- Coefficient heights are admissible exactly when the series is restricted at some positive\nradius. This includes the zero series, whose heights are all infinite. -/\ntheorem isAdmissible_addValuation_coeff_iff_exists_isRestricted :\n IsAdmissible (fun n => v (f.coeff n)) \u2194 \u2203 r : \u211d, 0 < r \u2227 f.IsRestricted r := by\n rw [isAdmissible_iff_exists_supportingValue_ne_bot]\n constructor\n \u00b7 rintro \u27e8\u03c3, h\u03c3\u27e9\n have hr : 0 < b ^ \u03c3 := Real.rpow_pos_of_pos (zero_lt_one.trans hb) \u03c3\n refine \u27e8b ^ \u03c3 / 2, half_pos hr,\n ((hasGaussNorm_iff_supportingValue_ne_bot f v hb hv \u03c3).mpr h\u03c3).isRestricted_of_abs_lt ?_\u27e9\n rw [abs_of_pos (half_pos hr)]\n exact half_lt_self hr\n \u00b7 rintro \u27e8r, hr, hf\u27e9\n refine \u27e8Real.logb b r, (hasGaussNorm_iff_supportingValue_ne_bot f v hb hv _).mp ?_\u27e9\n rw [Real.rpow_logb (zero_lt_one.trans hb) hb.ne' hr]\n exact TauCeti.PowerSeries.hasGaussNorm_of_isRestricted hf\n\n/-- For a nonzero series with bounded weighted coefficient norms, the supporting value of its\ncoefficient heights is the negative base-`b` logarithm of its Gauss norm. The Gauss norm need\nnot be attained. -/\ntheorem supportingValue_addValuation_coeff_eq_neg_logb_gaussNorm {\u03c3 : \u211d}\n (hf : f.HasGaussNorm norm (b ^ \u03c3)) (hf0 : f \u2260 0) :\n supportingValue (fun n => v (f.coeff n)) \u03c3 =\n ((-Real.logb b (f.gaussNorm norm (b ^ \u03c3)) : \u211d) : EReal) := by\n have hb0 : 0 < b := zero_lt_one.trans hb\n have hpow : b ^ (-(-Real.logb b (f.gaussNorm norm (b ^ \u03c3)))) = f.gaussNorm norm (b ^ \u03c3) := by\n rw [neg_neg, Real.rpow_logb hb0 hb.ne'\n (TauCeti.PowerSeries.gaussNorm_pos (Real.rpow_pos_of_pos hb0 \u03c3) hf hf0)]\n refine le_antisymm ?_ (isSupportingLine_iff.mp\n ((isSupportingLine_addValuation_coeff_iff_gaussNorm_le f v hb hv hf _).mpr hpow.ge))\n by_contra h\n obtain \u27e8c, hc, hc'\u27e9 := EReal.exists_between_coe_real (lt_of_not_ge h)\n have hle := (isSupportingLine_addValuation_coeff_iff_gaussNorm_le f v hb hv hf c).mp\n (isSupportingLine_iff.mpr hc'.le)\n rw [\u2190 hpow, Real.rpow_le_rpow_left_iff hb, neg_le_neg_iff] at hle\n exact (EReal.coe_lt_coe_iff.mp hc).not_ge hle\n\n/-- The Newton polygon of a nonzero series with bounded weighted coefficient norms has\nsupporting value equal to the negative base-`b` logarithm of the Gauss norm. Boundedness at\nthis radius already makes the coefficient heights admissible. -/\ntheorem supportingValue_newtonPolygon_eq_neg_logb_gaussNorm {\u03c3 : \u211d}\n (hf : f.HasGaussNorm norm (b ^ \u03c3)) (hf0 : f \u2260 0) :\n supportingValue (f.newtonPolygon v) \u03c3 =\n ((-Real.logb b (f.gaussNorm norm (b ^ \u03c3)) : \u211d) : EReal) := by\n rw [supportingValue_newtonPolygon (isAdmissible_iff_exists_supportingValue_ne_bot.mpr\n \u27e8\u03c3, (hasGaussNorm_iff_supportingValue_ne_bot f v hb hv \u03c3).mp hf\u27e9)]\n exact supportingValue_addValuation_coeff_eq_neg_logb_gaussNorm f v hb hv hf hf0\n\n/-- For a nonzero series with bounded weighted coefficient norms, the coefficients touching the\nsupporting line of slope `\u03c3` are exactly those attaining the Gauss norm at the radius\n`b ^ \u03c3`. The intercept of that line is the supporting value\n`-Real.logb b (f.gaussNorm norm (b ^ \u03c3))`. -/\ntheorem mem_supportingFace_addValuation_coeff_iff {\u03c3 : \u211d}\n (hf : f.HasGaussNorm norm (b ^ \u03c3)) (hf0 : f \u2260 0) (n : \u2115) :\n n \u2208 supportingFace (fun n => v (f.coeff n)) \u03c3 (-Real.logb b (f.gaussNorm norm (b ^ \u03c3))) \u2194\n \u2016f.coeff n\u2016 * (b ^ \u03c3) ^ n = f.gaussNorm norm (b ^ \u03c3) := by\n have hb0 : 0 < b := zero_lt_one.trans hb\n rw [mem_supportingFace, \u2190 norm_coeff_mul_rpow_pow_eq_iff f v hb hv, neg_neg,\n Real.rpow_logb hb0 hb.ne'\n (TauCeti.PowerSeries.gaussNorm_pos (Real.rpow_pos_of_pos hb0 \u03c3) hf hf0)]\n\n/-- The distinguished degree at the radius `b ^ \u03c3`, the last index attaining the Gauss norm, is\nthe greatest contact index of the supporting line of slope `\u03c3` with the coefficient heights. -/\ntheorem isDistinguished_iff_isGreatest_supportingFace {\u03c3 : \u211d}\n (hf : f.HasGaussNorm norm (b ^ \u03c3)) (s : \u2115) :\n TauCeti.PowerSeries.IsDistinguished (b ^ \u03c3) s f \u2194\n IsGreatest (supportingFace (fun n => v (f.coeff n)) \u03c3\n (-Real.logb b (f.gaussNorm norm (b ^ \u03c3)))) s := by\n by_cases hf0 : f = 0\n \u00b7 subst hf0\n exact iff_of_false (fun h => h.ne_zero rfl) fun h => by\n have := mem_supportingFace.mp h.1\n rw [map_zero, AddValuation.map_zero] at this\n exact WithTop.top_ne_coe this\n \u00b7 simp only [IsGreatest, mem_upperBounds,\n mem_supportingFace_addValuation_coeff_iff f v hb hv hf hf0]\n refine \u27e8fun hs => \u27e8hs.norm_coeff_mul_pow_eq, fun m hm => not_lt.mp fun hsm =>\n (hs.norm_coeff_mul_pow_lt m hsm).ne hm\u27e9, fun hs => \u27e8hs.1, fun m hsm => ?_\u27e9\u27e9\n exact (le_gaussNorm norm _ f hf m).lt_of_ne fun hm => (hs.2 m hm).not_gt hsm\n\n/-- The lowest dominant degree at the radius `b ^ \u03c3`, the first index attaining the Gauss norm,\nis the least contact index of the supporting line of slope `\u03c3` with the coefficient heights. -/\ntheorem isLowestDominant_iff_isLeast_supportingFace {\u03c3 : \u211d}\n (hf : f.HasGaussNorm norm (b ^ \u03c3)) (s : \u2115) :\n TauCeti.PowerSeries.IsLowestDominant (b ^ \u03c3) s f \u2194\n IsLeast (supportingFace (fun n => v (f.coeff n)) \u03c3\n (-Real.logb b (f.gaussNorm norm (b ^ \u03c3)))) s := by\n by_cases hf0 : f = 0\n \u00b7 subst hf0\n exact iff_of_false (fun h => h.ne_zero rfl) fun h => by\n have := mem_supportingFace.mp h.1\n rw [map_zero, AddValuation.map_zero] at this\n exact WithTop.top_ne_coe this\n \u00b7 simp only [IsLeast, mem_lowerBounds,\n mem_supportingFace_addValuation_coeff_iff f v hb hv hf hf0]\n refine \u27e8fun hs => \u27e8hs.norm_coeff_mul_pow_eq, fun m hm => not_lt.mp fun hms =>\n (hs.norm_coeff_mul_pow_lt m hms).ne hm\u27e9, fun hs => \u27e8?_, hs.1, fun m hms => ?_\u27e9\u27e9\n \u00b7 exact TauCeti.PowerSeries.gaussNorm_pos (Real.rpow_pos_of_pos (zero_lt_one.trans hb) \u03c3)\n hf hf0\n \u00b7 exact (le_gaussNorm norm _ f hf m).lt_of_ne fun hm => (hs.2 m hm).not_gt hms\n\n/-- The coefficient heights of a nonzero series restricted at the radius `b ^ \u03c3` touch a\nsupporting line of slope `\u03c3`. -/\ntheorem exists_isSupportingLine_mem_supportingFace_of_isRestricted {\u03c3 : \u211d}\n (hf : f.IsRestricted (b ^ \u03c3)) (hf0 : f \u2260 0) :\n \u2203 (c : \u211d) (i : \u2115), IsSupportingLine (fun n => v (coeff n f)) \u03c3 c \u2227\n i \u2208 supportingFace (fun n => v (coeff n f)) \u03c3 c := by\n have hfn := TauCeti.PowerSeries.hasGaussNorm_of_isRestricted hf\n obtain \u27e8s, hs\u27e9 := TauCeti.PowerSeries.exists_isDistinguished\n (Real.rpow_pos_of_pos (zero_lt_one.trans hb) \u03c3) hf hf0\n exact \u27e8_, s, isSupportingLine_iff.mpr\n (supportingValue_addValuation_coeff_eq_neg_logb_gaussNorm f v hb hv hfn hf0).ge,\n ((isDistinguished_iff_isGreatest_supportingFace f v hb hv hfn s).mp hs).1\u27e9\n\n/-- A series restricted at the radius `b ^ \u03c3` has a Newton polygon whose supporting value at `\u03c3`\nis above `\u22a5`. -/\ntheorem supportingValue_newtonPolygon_ne_bot_of_isRestricted {\u03c3 : \u211d}\n (hf : f.IsRestricted (b ^ \u03c3)) : supportingValue (f.newtonPolygon v) \u03c3 \u2260 \u22a5 := by\n have h := (hasGaussNorm_iff_supportingValue_ne_bot f v hb hv \u03c3).mp\n (TauCeti.PowerSeries.hasGaussNorm_of_isRestricted hf)\n rwa [supportingValue_newtonPolygon (isAdmissible_iff_exists_supportingValue_ne_bot.mpr \u27e8\u03c3, h\u27e9)]\n\nend PowerSeries\n\nnamespace Polynomial\n\nsection SupportingValue\n\nvariable {K : Type*} [NormedDivisionRing K] (p : Polynomial K)\n (v : AddValuation K (WithTop \u211d)) {b : \u211d} (hb : 1 < b)\n (hv : \u2200 x \u2260 0, \u2016x\u2016 = b ^ (-(v x).untop\u2080))\n\ninclude hb hv\n\n/-- At every slope `\u03c3`, the Newton polygon of a nonzero polynomial has supporting value equal\nto the negative base-`b` logarithm of its Gauss norm at the radius `b ^ \u03c3`. -/\ntheorem supportingValue_newtonPolygon_eq_neg_logb_gaussNorm (hp : p \u2260 0) (\u03c3 : \u211d) :\n supportingValue (p.newtonPolygon v) \u03c3 =\n ((-Real.logb b ((p : PowerSeries K).gaussNorm norm (b ^ \u03c3)) : \u211d) : EReal) := by\n rw [\u2190 newtonPolygon_coe]\n exact PowerSeries.supportingValue_newtonPolygon_eq_neg_logb_gaussNorm _ v hb hv\n (TauCeti.PowerSeries.hasGaussNorm_of_isRestricted\n (TauCeti.PowerSeries.isRestricted_polynomial p))\n (Polynomial.coe_eq_zero_iff.not.mpr hp)\n\nend SupportingValue\n\nsection Pure\n\nvariable {K : Type*} [NormedDivisionRing K] {v : AddValuation K (WithTop \u211d)} {b : \u211d}\n\n", "statement": "/-- **Purity criterion, Gauss form.** Let the norm be `\u2016x\u2016 = b ^ (-v x)` for `x \u2260 0`, with\n`1 < b`. Every finite slope of `f` equals `m` exactly when, at the radius `b ^ m`, the weighted\nleading and trailing terms have the same norm and every weighted term has norm at most that of\nthe trailing term. -/\ntheorem forall_mem_newtonSlopes_eq_iff_norm_coeff_mul_rpow_pow_le (hb : 1 < b)\n (hv : \u2200 x \u2260 0, \u2016x\u2016 = b ^ (-(v x).untop\u2080)) {f : K[X]} {m : \u211d} :\n (\u2200 s \u2208 f.newtonSlopes v, s = m) \u2194\n \u2016f.leadingCoeff\u2016 * (b ^ m) ^ f.natDegree =\n \u2016f.trailingCoeff\u2016 * (b ^ m) ^ f.natTrailingDegree \u2227\n \u2200 n, \u2016f.coeff n\u2016 * (b ^ m) ^ n \u2264 \u2016f.trailingCoeff\u2016 * (b ^ m) ^ f.natTrailingDegree ", "proof": " by\n rcases eq_or_ne f 0 with rfl | hf\n \u00b7 simp\n have hnorm {n : \u2115} (hn : f.coeff n \u2260 0) :\n \u2016f.coeff n\u2016 * (b ^ m) ^ n = b ^ (-((v (f.coeff n)).untop\u2080 - m * n)) := by\n simpa using (f : PowerSeries K).norm_coeff_mul_rpow_pow_eq v hb hv (by simpa using hn) m\n rw [forall_mem_newtonSlopes_eq_iff (mt v.top_iff.mp (Polynomial.trailingCoeff_ne_zero.mpr hf))\n (mt v.top_iff.mp (leadingCoeff_ne_zero.mpr hf)), \u2190 coeff_natDegree, trailingCoeff,\n hnorm (coeff_natTrailingDegree_ne_zero.mpr hf),\n hnorm (by rw [coeff_natDegree]; exact leadingCoeff_ne_zero.mpr hf),\n Real.rpow_right_inj (zero_lt_one.trans hb) hb.ne']\n refine and_congr \u27e8fun h => by rw [h]; ring, fun h => by linarith\u27e9 (forall_congr' fun n => ?_)\n have hle := PowerSeries.norm_coeff_mul_rpow_pow_le_iff (f : PowerSeries K) v hb hv n m\n ((v (f.coeff f.natTrailingDegree)).untop\u2080 - m * f.natTrailingDegree)\n rw [coeff_coe] at hle\n rw [hle]\n convert Iff.rfl using 3\n ring", "proof_lines": 17, "proof_length": 903, "rev": "75c8aed5fea63047615a25a9763fd5b68a86e891", "heartbeats": 1884, "image": "lean-compression:tauceti-75c8aed5fe-a608030cfc", "split": "dev"} {"path": "TauCeti/RingTheory/Polynomial/Resultant/Basic.lean", "module": "TauCeti.RingTheory.Polynomial.Resultant.Basic", "theorem": "Polynomial.resultant_one_sub_C_mul_X_right", "prefix": "/-\nCopyright (c) 2026 The Tau Ceti contributors. All rights reserved.\nReleased under Apache 2.0 license as described in the file LICENSE.\nAuthors: The Tau Ceti contributors\n-/\nmodule\n\npublic import Mathlib.RingTheory.IntegralClosure.IntegrallyClosed\npublic import Mathlib.RingTheory.Jacobson.Ideal\npublic import Mathlib.RingTheory.Polynomial.Eisenstein.Distinguished\npublic import Mathlib.RingTheory.Polynomial.Resultant.Basic\nimport Mathlib.RingTheory.Polynomial.GaussLemma\nimport TauCeti.Algebra.Polynomial.Degree.Operations\nimport TauCeti.Algebra.Polynomial.RingDivision\n\n/-!\n# Resultant lemmas\n\nMathlib evaluates the resultant against the linear polynomial `X - C x` on either side\n(`Polynomial.resultant_X_sub_C_left`, `Polynomial.resultant_X_sub_C_right`). This file records the\ncompanion for the *reversed* polynomial `C x - X`, which is the shape that arises as `x - \u03b8` in\n`AdjoinRoot f`: the answer is `f.eval x`, with **no sign**.\n\nThe file also normalizes bounded resultants with a monic left argument. This makes the resultant\nindependent of the chosen valid right degree bound, as needed when comparing resultant-based\ndiscriminant formulas that use different bounds, and makes `f.resultant` multiplicative in its\nright argument with no leading-coefficient assumption on the right factors. Over an integrally\nclosed domain, vanishing of `f.resultant g` for a monic irreducible `f` is equivalent to `f \u2223 g`.\n\nThat absence is the point. `C x - X` is `C (-1) * (X - C x)`, which contributes `(-1) ^ m`, and\n`resultant_X_sub_C_right` contributes another `(-1) ^ m`, so the two cancel.\n\nThe resultant with `1 - t X` at a degree bound `n` for `f` is the value at `t` of the reversal\n`reflect n f`, and the multiplicativity `Res(f\u2081 * f\u2082, g) = Res(f\u2081, g) * Res(f\u2082, g)` holds for\narbitrary valid degree bounds, the bounds adding. These are the identities behind Coleman's\nspectral transform, whose rank is a specified degree bound rather than an actual degree.\nReversing both arguments at their degree bounds changes the resultant only by the sign\n`(-1) ^ (m * n)`, with no degree hypothesis: the reversals permute the rows of the Sylvester\nmatrix and the columns within each of its two blocks.\n\nResultants taken at the actual degrees commute with any coefficient map preserving both\ndegrees, the form of base change used when comparing a resultant with its specializations.\nFinally, the entries of the Sylvester matrix are written out explicitly, column by column, for\nexpanding its determinant term by term.\n\nSince a resultant with a monic left argument is a unit exactly when the two polynomials are\ncoprime, coprimality can be read off a unit resultant; in particular, coprimality with a monic\npolynomial lifts from the reductions modulo an ideal in the Jacobson radical.\n\n## Main results\n\n* `Polynomial.sylvester_apply_of_lt`, `Polynomial.sylvester_apply_of_le`: the entries of the\n Sylvester matrix in its first `n` and its last `m` columns.\n* `Polynomial.resultant_C_sub_X_right`\n* `Polynomial.resultant_one_sub_C_mul_X_right`: `Res_(n,1)(f, 1 - t X) = (reflect n f)(t)`.\n* `Polynomial.resultant_mul_left_of_natDegree_le`: multiplicativity in the left argument at\n arbitrary degree bounds.\n* `Polynomial.resultant_prod_left_of_monic`: multiplicativity in a finite product of monic left\n arguments, at the actual degrees.\n* `Polynomial.resultant_reflect`: reversing both arguments at their degree bounds multiplies the\n resultant by `(-1) ^ (m * n)`.\n* `Polynomial.resultant_map_of_natDegree_eq`: resultants at the actual degrees commute with a\n coefficient map that preserves both degrees.\n* `Polynomial.Monic.resultant_of_le`, `Polynomial.Monic.resultant_mul_right`,\n `Polynomial.Monic.resultant_prod_right`: for a monic left argument, the resultant is independent\n of the valid degree bound supplied for the right argument, and hence multiplicative in the right\n argument.\n* `Polynomial.Monic.resultant_eq_zero_iff_dvd`: over an integrally closed domain, for a monic\n irreducible `f`, `f.resultant g = 0` iff `f \u2223 g`.\n* `Polynomial.resultant_sub_mem_of_map_eq`: polynomials congruent modulo an ideal have congruent\n resultants.\n* `Polynomial.Monic.resultant_ne_zero_of_not_dvd`: over an integrally closed domain, a monic\n irreducible polynomial has nonzero resultant against every polynomial it does not divide.\n* `Polynomial.resultant_congr_of_coeff_eq`: the resultant at degree bounds `m` and `n` only sees\n the coefficients of index at most `m` and `n`.\n* `Polynomial.resultant_C_mul_X_add_C_C_mul_X_add_C`: `Res_{1,1}(a X + b, c X + e) = a e - b c`.\n* `Polynomial.exists_mul_add_mul_eq_C_resultant_mul`: for `f`, `g` of degrees at most `m`, `n` and\n any `P` of degree less than `m + n` there are `p`, `q` of degrees less than `n`, `m` with\n `f p + g q = Res_{m,n}(f, g) P`.\n* `Polynomial.isCoprime_of_isCoprime_map`: a monic polynomial and any polynomial whose reductions\n modulo an ideal in the Jacobson radical are coprime are themselves coprime.\n* `Polynomial.IsDistinguishedAt.isUnit_resultant_of_isUnit_coeff_zero`: a polynomial distinguished\n at an ideal contained in the Jacobson radical has unit resultant with every polynomial whose\n constant coefficient is a unit.\n\n## Provenance\n\n`Polynomial.resultant_C_sub_X_right` is adapted from Michael Stoll's `EllipticCurves`\n(`github.com/MichaelStollBayreuth/EllipticCurves`, Apache-2.0) at commit\n`66889eada51a74c2f5dfb7fb5909b0b5a0a2d96e`, `EllipticCurves/Mathlib/Basic.lean` line 615, where\nit is a Mathlib-bound prerequisite of the explicit `2`-descent.\n-/\n\npublic section\n\nnamespace Polynomial\n\nsection Sylvester\n\nvariable {S : Type*} [Semiring S]\n\n/-- An entry of the Sylvester matrix in one of the first `n` columns, which carry the\ncoefficients of the second polynomial. -/\ntheorem sylvester_apply_of_lt (f g : S[X]) {n m : \u2115} (i x : Fin (n + m))\n (hx : (x : \u2115) < n) :\n sylvester f g n m i x =\n if (x : \u2115) \u2264 i \u2227 (i : \u2115) \u2264 x + m then g.coeff (i - x) else 0 := by\n obtain \u27e8x, rfl\u27e9 : \u2203 y : Fin n, Fin.castAdd m y = x := \u27e8\u27e8x, hx\u27e9, rfl\u27e9\n simp [sylvester]\n\n/-- An entry of the Sylvester matrix in one of the last `m` columns, which carry the\ncoefficients of the first polynomial. -/\ntheorem sylvester_apply_of_le (f g : S[X]) {n m : \u2115} (i x : Fin (n + m))\n (hx : n \u2264 (x : \u2115)) :\n sylvester f g n m i x =\n if (x : \u2115) \u2264 i + n \u2227 (i : \u2115) \u2264 x then f.coeff (i + n - x) else 0 := by\n obtain \u27e8x, rfl\u27e9 : \u2203 y : Fin m, Fin.natAdd n y = x :=\n \u27e8\u27e8x - n, by omega\u27e9, Fin.ext (by simp; omega)\u27e9\n simp only [sylvester, Matrix.of_apply, Fin.addCases_right, Set.mem_Icc, Fin.val_natAdd]\n congr 1\n \u00b7 exact propext (by omega)\n \u00b7 congr 1; omega\n\n/-- The permutation of `Fin (m + n)` reversing each of the blocks `Fin m` and `Fin n`. -/\nprivate def blockRevPerm (m n : \u2115) : Equiv.Perm (Fin (m + n)) :=\n finSumFinEquiv.symm.trans ((Equiv.sumCongr Fin.revPerm Fin.revPerm).trans finSumFinEquiv)\n\n/-- Reversing both polynomials at their degree bounds reverses the rows of the Sylvester matrix\nand the columns within each of its two blocks. -/\nprivate theorem sylvester_reflect (f g : S[X]) (m n : \u2115) :\n sylvester (f.reflect m) (g.reflect n) m n =\n (sylvester f g m n).submatrix Fin.revPerm (blockRevPerm m n) := by\n ext i j\n have hi := i.isLt\n induction j using Fin.addCases with\n | left j =>\n simp only [sylvester, blockRevPerm, Matrix.submatrix_apply, Matrix.of_apply,\n Equiv.trans_apply, finSumFinEquiv_symm_apply_castAdd, Equiv.sumCongr_apply, Sum.map_inl,\n finSumFinEquiv_apply_left, Fin.addCases_left, Fin.revPerm_apply, Set.mem_Icc, Fin.val_rev,\n coeff_reflect]\n have hj := j.isLt\n by_cases h : (j : \u2115) \u2264 i \u2227 (i : \u2115) \u2264 j + n\n \u00b7 rw [ite_eq_left h, ite_eq_left (by omega), revAt_le (by omega)]\n congr 1\n omega\n \u00b7 rw [ite_eq_right h, ite_eq_right (by omega)]\n | right j =>\n simp only [sylvester, blockRevPerm, Matrix.submatrix_apply, Matrix.of_apply,\n Equiv.trans_apply, finSumFinEquiv_symm_apply_natAdd, Equiv.sumCongr_apply, Sum.map_inr,\n finSumFinEquiv_apply_right, Fin.addCases_right, Fin.revPerm_apply, Set.mem_Icc,\n Fin.val_rev, coeff_reflect]\n have hj := j.isLt\n by_cases h : (j : \u2115) \u2264 i \u2227 (i : \u2115) \u2264 j + m\n \u00b7 rw [ite_eq_left h, ite_eq_left (by omega), revAt_le (by omega)]\n congr 1\n omega\n \u00b7 rw [ite_eq_right h, ite_eq_right (by omega)]\n\nend Sylvester\n\nvariable {R : Type*} [CommRing R]\n\n/-- The resultant of `f` with the reversed linear polynomial `C x - X` is `f.eval x`. Note the\nabsence of a sign: `C x - X` is `-(X - C x)`, and the two signs cancel. -/\n@[simp]\ntheorem resultant_C_sub_X_right (f : R[X]) (x : R) (m : \u2115) (hm : f.natDegree \u2264 m) :\n f.resultant (C x - X) m 1 = f.eval x := by\n -- `C x - X` is `X - C x` scaled by the constant `-1`\n have hneg : C x - X = C (-1 : R) * (X - C x) := by simp\n rw [hneg, resultant_C_mul_right, resultant_X_sub_C_right f m x hm, \u2190 mul_assoc, \u2190 pow_add,\n \u2190 two_mul, pow_mul, neg_one_sq, one_pow, one_mul]\n\n/-- `Res(f\u2081 * f\u2082, g) = Res(f\u2081, g) * Res(f\u2082, g)` for arbitrary valid degree bounds: the bound for\nthe product is the sum of the bounds for the factors. -/\ntheorem resultant_mul_left_of_natDegree_le {f\u2081 f\u2082 g : R[X]} {m\u2081 m\u2082 n : \u2115}\n (hf\u2081 : f\u2081.natDegree \u2264 m\u2081) (hf\u2082 : f\u2082.natDegree \u2264 m\u2082) (hg : g.natDegree \u2264 n) :\n (f\u2081 * f\u2082).resultant g (m\u2081 + m\u2082) n = f\u2081.resultant g m\u2081 n * f\u2082.resultant g m\u2082 n := by\n obtain \u27e8k\u2081, rfl\u27e9 := Nat.exists_eq_add_of_le hf\u2081\n obtain \u27e8k\u2082, rfl\u27e9 := Nat.exists_eq_add_of_le hf\u2082\n rw [Nat.add_add_add_comm, resultant_add_left_deg _ _ _ _ _ natDegree_mul_le,\n resultant_mul_left _ _ _ _ hg, resultant_add_left_deg _ _ _ _ _ le_rfl,\n resultant_add_left_deg _ _ _ _ _ le_rfl]\n ring\n\n/-- `Res(\u220f f\u1d62, g) = \u220f Res(f\u1d62, g)` for a finite product of monic polynomials, the resultants being\ntaken at the actual degrees. -/\ntheorem resultant_prod_left_of_monic {\u03b9 : Type*} (s : Finset \u03b9) {f : \u03b9 \u2192 R[X]}\n (hf : \u2200 i \u2208 s, (f i).Monic) (g : R[X]) :\n (\u220f i \u2208 s, f i).resultant g = \u220f i \u2208 s, (f i).resultant g := by\n nontriviality R\n refine resultant_prod_left s f g _ ?_ le_rfl\n rw [Finset.prod_congr rfl fun i hi \u21a6 (hf i hi).leadingCoeff, Finset.prod_const_one]\n exact one_ne_zero\n\n", "statement": "/-- The resultant of `f` with the linear polynomial `1 - t X`, at the degree bound `n` for `f`, is\nthe value at `t` of the reversal of `f` in degree `n`. When `f = \u220f (X - \u03b1\u1d62)` has degree `n`, both\nsides are `\u220f (1 - \u03b1\u1d62 t)`. -/\ntheorem resultant_one_sub_C_mul_X_right (f : R[X]) (t : R) {n : \u2115} (hf : f.natDegree \u2264 n) :\n f.resultant (1 - C t * X) n 1 = (f.reflect n).eval t ", "proof": " by\n set \u2113 : R[X] := 1 - C t * X\n have h\u2113 : \u2113.natDegree \u2264 1 := natDegree_one_sub_C_mul_X_le t\n -- the value of the reversal, as a sum over the coefficients of `f`\n set c : R := \u2211 j \u2208 Finset.range (n + 1), f.coeff j * t ^ (n - j)\n have hc : (f.reflect n).eval t = c := by\n rw [eval_eq_sum_range' (Nat.lt_succ_of_le (natDegree_reflect_le.trans (max_le le_rfl hf))),\n \u2190 Finset.sum_range_reflect]\n refine Finset.sum_congr rfl fun j hj \u21a6 ?_\n have hj : j \u2264 n := Nat.lt_succ_iff.mp (Finset.mem_range.mp hj)\n rw [Nat.succ_sub_one, coeff_reflect, revAt_le (Nat.sub_le n j), Nat.sub_sub_self hj]\n rw [hc]\n obtain _ | n := n\n \u00b7 rw [resultant_zero_left_deg]\n simp [c]\n -- modulo `\u2113`, `X ^ j` is congruent to `t ^ (n - j) * X ^ n`, through a polynomial of degree `< n`\n set p : R[X] := -\u2211 j \u2208 Finset.range (n + 2), \u2211 i \u2208 Finset.range (n + 1 - j),\n C (f.coeff j * t ^ i) * X ^ (j + i)\n have hp : p.natDegree + 1 \u2264 n + 1 := by\n refine Nat.succ_le_succ ((natDegree_neg _).le.trans (natDegree_sum_le_of_forall_le _ _\n fun j _ \u21a6 natDegree_sum_le_of_forall_le _ _ fun i hi \u21a6 ?_))\n exact (natDegree_C_mul_X_pow_le _ _).trans (by simp at hi; lia)\n have hfp : f + \u2113 * p = C c * X ^ (n + 1) := by\n have hgeom (j : \u2115) : \u2113 * \u2211 i \u2208 Finset.range (n + 1 - j), C (f.coeff j * t ^ i) * X ^ (j + i)\n = C (f.coeff j) * X ^ j - C (f.coeff j) * X ^ j * (C t * X) ^ (n + 1 - j) := by\n rw [\u2190 mul_one_sub, \u2190 mul_neg_geom_sum]\n simp only [Finset.mul_sum]\n refine Finset.sum_congr rfl fun i _ \u21a6 ?_\n simp only [\u2113, C_mul, C_pow]\n ring\n rw [as_sum_range_C_mul_X_pow' f (n := n + 2) (by lia), mul_neg, Finset.mul_sum,\n Finset.sum_congr rfl fun j _ \u21a6 hgeom j, Finset.sum_sub_distrib, neg_sub, add_sub_cancel]\n simp only [c, map_sum, Finset.sum_mul]\n refine Finset.sum_congr rfl fun j hj \u21a6 ?_\n have hj : j \u2264 n + 1 := Nat.lt_succ_iff.mp (Finset.mem_range.mp hj)\n rw [\u2190 pow_mul_pow_sub X hj, C_mul, C_pow]\n ring\n rw [\u2190 resultant_add_mul_left f \u2113 p (n + 1) 1 hp h\u2113, hfp, resultant_C_mul_left,\n resultant_X_pow_left _ _ _ h\u2113]\n simp [\u2113]", "proof_lines": 39, "proof_length": 1779, "rev": "75c8aed5fea63047615a25a9763fd5b68a86e891", "heartbeats": 5570, "image": "lean-compression:tauceti-75c8aed5fe-a608030cfc", "split": "dev"} {"path": "TauCeti/LinearAlgebra/RootSystem/Inversions/StrongExchange.lean", "module": "TauCeti.LinearAlgebra.RootSystem.Inversions.StrongExchange", "theorem": "RootPairing.exists_wordProd_drop_apply_eq_and_wordProd_eraseIdx_eq_mul_ofIdx", "prefix": "/-\nCopyright (c) 2026 The Tau Ceti contributors. All rights reserved.\nReleased under Apache 2.0 license as described in the file LICENSE.\nAuthors: The Tau Ceti contributors\n-/\nmodule\n\npublic import TauCeti.LinearAlgebra.RootSystem.Inversions.Exchange\npublic import TauCeti.LinearAlgebra.RootSystem.SimpleReflections\n\n/-!\n# The strong exchange condition and the identity criterion for inversion sets\n\nIf a word in the simple reflections spells a Weyl-group element sending a positive root to a\nnegative root, then appending the reflection in that root to the word is spelled by the word with\none of its letters deleted. This is the strong exchange condition, and it is the missing half of\nthe identification of the inversion set as the obstruction to being the identity: an element with\nan empty inversion set is spelled by the empty word, so it is the identity.\n\nTwo features of the statement are what make it usable and are not shared by the weaker \"some\nshorter word exists\" form. The reflecting root ranges over *all* positive roots, not just the\nsimple ones, so the condition applies to an arbitrary reflection of the Weyl group; and the\nshorter word is `l.eraseIdx j` for a named position `j`, a deletion that can be replayed verbatim\non the corresponding word over any other family of generators indexed by `b.support`, in particular\nover the generators of the presented Coxeter group. The weaker form asserts only that some shorter\nword exists inside the Weyl group; it names no word over those generators to carry the assertion\nback through the presentation map, which is why the word property behind Tits' theorem consumes the\ndeletion form.\n\nThe proof is an induction on the word. Peeling off the leading simple reflection `s\u2c7c`, either the\nshorter word already sends the root to a negative root, and the inductive hypothesis deletes a\nletter from it, or the shorter word sends it to a positive root that `s\u2c7c` makes negative. In the\nsecond case that positive root must be the simple root `\u03b1\u2c7c` itself, because a simple reflection\npermutes the remaining positive roots, and then conjugation identifies `s\u2c7c` with the appended\nreflection, so the leading letter is the one deleted.\n\n## Main results\n\n* `RootPairing.exists_wordProd_drop_apply_eq_and_wordProd_eraseIdx_eq_mul_ofIdx` is the strong\n exchange condition.\n* `TauCeti.eq_one_of_inversions_eq_empty` and `TauCeti.inversions_eq_empty_iff_eq_one` say that the\n inversion set of a Weyl-group element is empty exactly when the element is the identity.\n* `TauCeti.eq_one_of_mapsTo_posRoots` restates this as: a Weyl-group element keeping every positive\n root positive is the identity.\n* `TauCeti.inversions_nonempty_of_ne_one` and `TauCeti.ncard_inversions_pos_of_ne_one` are the\n contrapositive forms used to detect nontrivial Weyl-group elements.\n* `TauCeti.exists_mem_support_mem_inversions_of_ne_one` sharpens the first of those to a *simple*\n inversion, which is what makes induction along right multiplication by simple reflections\n available.\n\n## References\n\nThis file supplies the root-level exchange condition, the step through which the Coxeter\npresentation proves that the braid relations are complete. The argument is the one in\nJ. E. Humphreys, *Introduction to Lie Algebras and Representation Theory*, GTM 9, Ch. III, \u00a710.3.\n-/\n\npublic section\n\nopen Set\n\nnamespace RootPairing\n\nopen TauCeti\n\nuniverse u v w x\n\nvariable {\u03b9 : Type u} {R : Type v} {M : Type w} {N : Type x}\n [CommRing R] [AddCommGroup M] [Module R M] [AddCommGroup N] [Module R N]\n (P : RootPairing \u03b9 R M N) [Finite \u03b9] [CharZero R] [IsDomain R]\n [P.IsCrystallographic] [P.IsReduced] (b : P.Base)\n\n", "statement": "/-- **The strong exchange condition with crossing suffix.** If the word `l` spells a Weyl-group\nelement sending the positive root `\u03b1\u2096` to a negative root, then there is an index `j < l.length`\nsuch that the suffix `l.drop (j + 1)` carries `\u03b1\u2096` to the simple root `l[j]` and the deleted word\n`l.eraseIdx j` spells `l` with the reflection `s\u2096` appended. The root `\u03b1\u2096` is an arbitrary\npositive root, not necessarily a simple one. -/\ntheorem exists_wordProd_drop_apply_eq_and_wordProd_eraseIdx_eq_mul_ofIdx {k : \u03b9} (hk : b.IsPos k)\n (l : List b.support) (h : \u00ac b.IsPos (P.weylGroupToPerm (wordProd P b l) k)) :\n \u2203 (j : \u2115) (hj : j < l.length),\n P.weylGroupToPerm (wordProd P b (l.drop (j + 1))) k = (l[j] : \u03b9) \u2227\n wordProd P b (l.eraseIdx j) = wordProd P b l * RootPairing.weylGroup.ofIdx P k ", "proof": " by\n induction l with\n | nil =>\n exact absurd (by simpa using hk) h\n | cons j l ih =>\n rw [wordProd_cons, RootPairing.weylGroupToPerm_ofIdx_mul_apply] at h\n by_cases hpos : b.IsPos (P.weylGroupToPerm (wordProd P b l) k)\n \u00b7 -- The shorter word keeps `\u03b1\u2096` positive, so the image is the simple root `\u03b1\u2c7c` itself.\n have hkey : P.weylGroupToPerm (wordProd P b l) k = (j : \u03b9) := by\n by_contra hne\n have hmem : P.weylGroupToPerm (wordProd P b l) k \u2208 posRoots P b \\ {(j : \u03b9)} :=\n \u27e8(mem_posRoots P b _).mpr hpos, by simpa using hne\u27e9\n exact h ((mem_posRoots P b _).mp\n ((reflectionPerm_mem_posRoots_diff_singleton_iff P b j.property _).mpr hmem).1)\n refine \u27e80, by simp, by simpa using hkey, ?_\u27e9\n rw [List.eraseIdx_cons_zero, wordProd_cons, \u2190 hkey,\n RootPairing.weylGroup.ofIdx_weylGroupToPerm_eq_conj,\n inv_mul_cancel_right, mul_assoc, RootPairing.weylGroup.ofIdx_mul_self, mul_one]\n \u00b7 -- The shorter word already makes `\u03b1\u2096` negative, so a letter is deleted from it.\n obtain \u27e8j', hj', hdrop, hl'\u27e9 := ih hpos\n refine \u27e8j' + 1, by simpa using hj', by simpa using hdrop, ?_\u27e9\n rw [List.eraseIdx_cons_succ, wordProd_cons, hl', wordProd_cons, mul_assoc]", "proof_lines": 21, "proof_length": 946, "rev": "75c8aed5fea63047615a25a9763fd5b68a86e891", "heartbeats": 2130, "image": "lean-compression:tauceti-75c8aed5fe-a608030cfc", "split": "dev"} {"path": "TauCeti/AlgebraicTopology/SimplicialSet/KanComplex/SimplicialGroup/Basic.lean", "module": "TauCeti.AlgebraicTopology.SimplicialSet.KanComplex.SimplicialGroup.Basic", "theorem": "SSet.kanComplex_of_group", "prefix": "/-\nCopyright (c) 2026 The Tau Ceti contributors. All rights reserved.\nReleased under Apache 2.0 license as described in the file LICENSE.\nAuthors: The Tau Ceti contributors\n-/\nmodule\n\npublic import Mathlib.AlgebraicTopology.SimplicialSet.KanComplex\npublic import Mathlib.Algebra.Category.ModuleCat.Basic\n\n/-!\n# Simplicial groups are Kan complexes\n\nA simplicial set whose sets of simplices are groups, with all simplicial operators group\nhomomorphisms, is a Kan complex (`SSet.kanComplex_of_group`, Moore's theorem). Hence the\nunderlying simplicial set of a simplicial group, of a simplicial abelian group and of a\nsimplicial module is a Kan complex.\n\nThis is what makes the combinatorial homotopy theory of simplicial groups available, and it is\nthe Kan property of the mapping spaces of simplicial categories built from simplicial abelian\ngroups, such as the Dold\u2013Kan images of connective chain complexes.\n\n## Proof\n\nBy `SSet.KanComplex.iff`, a horn `\u039b[n + 1, i] \u27f6 X` is a compatible family of `n`-simplices\n`y j`, one for each face `j \u2260 i`. The filler is built by correcting faces one at a time. Below\n`i`, from the bottom up: if `w` already has the faces `y j` for `j < r`, then\n`w * \u03c3 r ((d r w)\u207b\u00b9 * y r)` also has the face `y r`, since the correction is the degeneracy of a\nsimplex whose faces below `r` are trivial by compatibility. Above `i`, from the top down: if\n`w` has the faces `y j` for `j < i` and `j > r`, then `w * \u03c3 (r - 1) ((d r w)\u207b\u00b9 * y r)` also has\nthe face `y r`, by the same argument.\n\n## Main results\n\n* `SSet.kanComplex_of_group`, `SSet.kanComplex_of_addGroup`: Moore's theorem for simplicial\n sets with group and with additive group structures.\n* `CategoryTheory.SimplicialObject.kanComplex_comp_forget_grpCat`,\n `CategoryTheory.SimplicialObject.kanComplex_comp_forget_addCommGrpCat` and\n `CategoryTheory.SimplicialObject.kanComplex_comp_forget_moduleCat`: the underlying simplicial\n sets of simplicial groups, simplicial abelian groups and simplicial modules are Kan complexes.\n\n## References\n\n* J. C. Moore, *Homotopie des complexes mono\u00efdaux, I*, S\u00e9minaire Henri Cartan 7 (1954\u20131955).\n* J. P. May, *Simplicial Objects in Algebraic Topology*, Theorem 17.1.\n* P. G. Goerss and J. F. Jardine, *Simplicial Homotopy Theory*, Lemma I.3.4.\n-/\n\npublic section\n\nuniverse u\n\nopen CategoryTheory Simplicial\n\nnamespace SSet\n\nsection Group\n\nvariable {X : SSet.{u}} [\u2200 n, Group (X.obj n)]\n (hX : \u2200 \u2983m n : SimplexCategory\u1d52\u1d56\u2984 (f : m \u27f6 n) (x y : X.obj m),\n X.map f (x * y) = X.map f x * X.map f y)\n\ninclude hX\n\nprivate lemma \u03b4_mul {n : \u2115} (j : Fin (n + 2)) (x y : X _\u298bn + 1\u298c) :\n X.\u03b4 j (x * y) = X.\u03b4 j x * X.\u03b4 j y :=\n hX _ x y\n\nprivate lemma \u03b4_inv {n : \u2115} (j : Fin (n + 2)) (x : X _\u298bn + 1\u298c) : X.\u03b4 j x\u207b\u00b9 = (X.\u03b4 j x)\u207b\u00b9 :=\n map_inv (MonoidHom.mk' (fun x => X.\u03b4 j x) (\u03b4_mul hX j)) x\n\nprivate lemma \u03c3_one {n : \u2115} (j : Fin (n + 1)) : X.\u03c3 j (1 : X _\u298bn\u298c) = 1 :=\n map_one (MonoidHom.mk' (fun x => X.\u03c3 j x) (hX _))\n\n/-- Multiplying `w` by the degeneracy `\u03c3 b ((\u03b4 k w)\u207b\u00b9 * v)` does not change its `a`-th face,\nwhen `\u03b4 a` turns `\u03c3 b` into `\u03c3 b'` after the face `\u03b4 a'`, and `\u03b4 k w` and `v` have the same\n`a'`-th face. -/\nprivate lemma \u03b4_mul_\u03c3_inv_mul {n : \u2115} {a k : Fin (n + 3)} {b a' : Fin (n + 2)} {b' : Fin (n + 1)}\n (h\u03c3 : \u2200 x : X _\u298bn + 1\u298c, X.\u03b4 a (X.\u03c3 b x) = X.\u03c3 b' (X.\u03b4 a' x)) {w : X _\u298bn + 2\u298c}\n {v : X _\u298bn + 1\u298c} (hv : X.\u03b4 a' (X.\u03b4 k w) = X.\u03b4 a' v) :\n X.\u03b4 a (w * X.\u03c3 b ((X.\u03b4 k w)\u207b\u00b9 * v)) = X.\u03b4 a w := by\n simp [\u03b4_mul hX, \u03b4_inv hX, h\u03c3, hv, \u03c3_one hX]\n\nvariable {m : \u2115} {i : Fin (m + 3)} {y : \u2200 j : Fin (m + 3), j \u2260 i \u2192 X _\u298bm + 1\u298c}\n (hy : \u2200 (j k : Fin (m + 3)) (hj : j \u2260 i) (hk : k \u2260 i) (hjk : j < k),\n X.\u03b4 (k.pred (Fin.ne_zero_of_lt hjk)) (y j hj) =\n X.\u03b4 (j.castPred (Fin.ne_last_of_lt hjk)) (y k hk))\n\ninclude hy\n\n/-- Correcting the face `b.castSucc < i` by multiplying with a degenerate simplex keeps the faces\nbelow it. -/\nprivate lemma exists_lower_step (b : Fin (m + 2)) (hbi : b.castSucc \u2260 i)\n (w : X _\u298bm + 2\u298c) (hw : \u2200 (j : Fin (m + 3)) (hj : j \u2260 i), j.val < b.val \u2192 X.\u03b4 j w = y j hj) :\n \u2203 w' : X _\u298bm + 2\u298c, \u2200 (j : Fin (m + 3)) (hj : j \u2260 i), j.val \u2264 b.val \u2192 X.\u03b4 j w' = y j hj := by\n refine \u27e8w * X.\u03c3 b ((X.\u03b4 b.castSucc w)\u207b\u00b9 * y b.castSucc hbi), fun j hj hjb => ?_\u27e9\n rcases lt_or_eq_of_le hjb with hjb | hjb\n \u00b7 -- Below `b`, the correction is the degeneracy of a simplex with trivial `j`-th face.\n obtain \u27e8j, rfl\u27e9 := Fin.exists_castSucc_eq.mpr (Fin.ne_of_val_ne (by simp; omega) : j \u2260 _)\n obtain \u27e8b, rfl\u27e9 := Fin.exists_succ_eq.mpr\n (Fin.ne_of_val_ne (by rw [Fin.val_zero]; simp at hjb; omega) : b \u2260 0)\n have hjb' : j \u2264 b.castSucc := Fin.le_def.mpr (by simp at hjb \u22a2; omega)\n rw [\u03b4_mul_\u03c3_inv_mul hX (\u03b4_comp_\u03c3_of_le_apply hjb') ?_, hw _ hj hjb]\n refine (\u03b4_comp_\u03b4_apply hjb' w).trans ?_\n rw [hw _ hj hjb]\n simpa using hy _ _ hj hbi (Fin.lt_def.mpr (by simpa using hjb))\n \u00b7 obtain rfl : j = b.castSucc := Fin.ext hjb\n rw [\u03b4_mul hX, \u03b4_comp_\u03c3_self_apply, mul_inv_cancel_left]\n\n/-- Correcting the face `b.succ > i` by multiplying with a degenerate simplex keeps the faces\nbelow `i` and above `b.succ`. -/\nprivate lemma exists_upper_step (b : Fin (m + 2)) (hbi : b.succ \u2260 i) (hb : i.val \u2264 b.val)\n (w : X _\u298bm + 2\u298c) (hlow : \u2200 (j : Fin (m + 3)) (hj : j \u2260 i), j.val < i.val \u2192 X.\u03b4 j w = y j hj)\n (hup : \u2200 (j : Fin (m + 3)) (hj : j \u2260 i), b.val + 1 < j.val \u2192 X.\u03b4 j w = y j hj) :\n \u2203 w' : X _\u298bm + 2\u298c, (\u2200 (j : Fin (m + 3)) (hj : j \u2260 i), j.val < i.val \u2192 X.\u03b4 j w' = y j hj) \u2227\n \u2200 (j : Fin (m + 3)) (hj : j \u2260 i), b.val < j.val \u2192 X.\u03b4 j w' = y j hj := by\n refine \u27e8w * X.\u03c3 b ((X.\u03b4 b.succ w)\u207b\u00b9 * y b.succ hbi), fun j hj hji => ?_, fun j hj hbj => ?_\u27e9\n \u00b7 -- Below `i`, the correction is the degeneracy of a simplex with trivial `j`-th face.\n obtain \u27e8j, rfl\u27e9 := Fin.exists_castSucc_eq.mpr (Fin.ne_of_val_ne (by simp; omega) : j \u2260 _)\n obtain \u27e8b, rfl\u27e9 := Fin.exists_succ_eq.mpr\n (Fin.ne_of_val_ne (by rw [Fin.val_zero]; simp at hji; omega) : b \u2260 0)\n have hjb : j \u2264 b.castSucc := Fin.le_def.mpr (by simp at hji hb \u22a2; omega)\n rw [\u03b4_mul_\u03c3_inv_mul hX (\u03b4_comp_\u03c3_of_le_apply hjb) ?_, hlow _ hj hji]\n rw [\u03b4_comp_\u03b4_apply (Fin.le_def.mpr (by simp at hji hb \u22a2; omega)), hlow _ hj hji]\n simpa using hy _ _ hj hbi (Fin.lt_def.mpr (by simp at hji hb \u22a2; omega))\n \u00b7 rcases lt_or_eq_of_le (Nat.succ_le_of_lt hbj) with hbj | hbj\n \u00b7 -- Above `b.succ`, the correction is the degeneracy of a simplex with trivial face.\n obtain \u27e8j, rfl\u27e9 := Fin.exists_succ_eq.mpr\n (Fin.ne_of_val_ne (by rw [Fin.val_zero]; omega) : j \u2260 0)\n obtain \u27e8b, rfl\u27e9 := Fin.exists_castSucc_eq.mpr\n (Fin.ne_of_val_ne (by rw [Fin.val_last]; simp at hbj; omega) : b \u2260 _)\n have hbj' : b.val < j.val := by simpa using hbj\n rw [\u03b4_mul_\u03c3_inv_mul hX (\u03b4_comp_\u03c3_of_gt_apply (Fin.lt_def.mpr hbj')) ?_,\n hup j.succ hj (by simp; omega)]\n -- `\u03b4_comp_\u03b4_apply` names the face `b.castSucc.succ` as `b.succ.castSucc`.\n have h\u03b4 := \u03b4_comp_\u03b4_apply (S := X) (i := b.succ) (j := j) (Fin.le_def.mpr (by simp; omega)) w\n rw [\u2190 Fin.succ_castSucc] at h\u03b4\n rw [\u2190 h\u03b4, hup j.succ hj (by simp; omega)]\n convert (hy _ _ hbi hj (Fin.lt_def.mpr (by simp; omega))).symm using 3 <;>\n simp [Fin.ext_iff]\n \u00b7 obtain rfl : j = b.succ := Fin.ext (by simpa using hbj.symm)\n rw [\u03b4_mul hX, \u03b4_comp_\u03c3_succ_apply, mul_inv_cancel_left]\n\n/-- Correcting the faces below `i` from the bottom up: for `r \u2264 i` there is an `(m + 2)`-simplex\nwhose faces `j < r` are the `y j`. -/\nprivate lemma exists_\u03b4_eq_of_lt (r : \u2115) (hr : r \u2264 i.val) :\n \u2203 w : X _\u298bm + 2\u298c, \u2200 (j : Fin (m + 3)) (hj : j \u2260 i), j.val < r \u2192 X.\u03b4 j w = y j hj := by\n induction r with\n | zero => exact \u27e81, fun j _ hj => absurd hj (Nat.not_lt_zero _)\u27e9\n | succ r ih =>\n obtain \u27e8w, hw\u27e9 := ih (by omega)\n obtain \u27e8w', hw'\u27e9 := exists_lower_step hX hy \u27e8r, by omega\u27e9\n (Fin.ne_of_val_ne (by simp; omega)) w hw\n exact \u27e8w', fun j hj hjr => hw' j hj (by simp; omega)\u27e9\n\n/-- Correcting the faces above `i` from the top down, keeping those below `i`: for\n`t \u2264 m + 2 - i` there is an `(m + 2)`-simplex whose faces `j < i` and `j > m + 2 - t` are the\n`y j`. -/\nprivate lemma exists_\u03b4_eq_of_lt_or_gt (t : \u2115) (ht : t \u2264 m + 2 - i.val) :\n \u2203 w : X _\u298bm + 2\u298c,\n (\u2200 (j : Fin (m + 3)) (hj : j \u2260 i), j.val < i.val \u2192 X.\u03b4 j w = y j hj) \u2227\n \u2200 (j : Fin (m + 3)) (hj : j \u2260 i), m + 2 - t < j.val \u2192 X.\u03b4 j w = y j hj := by\n induction t with\n | zero =>\n obtain \u27e8w, hw\u27e9 := exists_\u03b4_eq_of_lt hX hy i.val le_rfl\n exact \u27e8w, hw, fun j _ hj => absurd hj (by omega)\u27e9\n | succ t ih =>\n obtain \u27e8w, hw, hw'\u27e9 := ih (by omega)\n obtain \u27e8w', hw\u2081, hw\u2082\u27e9 := exists_upper_step hX hy \u27e8m + 1 - t, by omega\u27e9\n (Fin.ne_of_val_ne (by simp; omega)) (by simp; omega) w hw\n (fun j hj hjt => hw' j hj (by simp at hjt; omega))\n exact \u27e8w', hw\u2081, fun j hj hjt => hw\u2082 j hj (by simp; omega)\u27e9\n\n/-- **Horn filling in a simplicial group**: a compatible family of `m + 1`-simplices on the faces\n`j \u2260 i` of an `(m + 2)`-simplex is the family of faces of an `(m + 2)`-simplex. -/\nprivate lemma exists_\u03b4_eq_of_group : \u2203 w : X _\u298bm + 2\u298c, \u2200 (j : Fin (m + 3)) (hj : j \u2260 i),\n X.\u03b4 j w = y j hj := by\n obtain \u27e8w, hw, hw'\u27e9 := exists_\u03b4_eq_of_lt_or_gt hX hy (m + 2 - i.val) le_rfl\n refine \u27e8w, fun j hj => ?_\u27e9\n rcases lt_or_gt_of_ne (Fin.val_ne_of_ne hj) with h | h\n \u00b7 exact hw j hj h\n \u00b7 exact hw' j hj (by omega)\n\n", "statement": "omit hy in\n/-- **Moore's theorem**: a simplicial set whose sets of simplices are groups, with simplicial\noperators group homomorphisms, is a Kan complex. -/\ntheorem kanComplex_of_group : X.KanComplex ", "proof": " by\n rw [KanComplex.iff]\n intro n i f hf\n suffices h : \u2203 x : X _\u298bn + 1\u298c, \u2200 (j : Fin (n + 2)) (hj : j \u2260 i), X.\u03b4 j x = yonedaEquiv (f j hj) by\n obtain \u27e8x, hx\u27e9 := h\n refine \u27e8yonedaEquiv.symm x, fun j hj => ?_\u27e9\n rw [stdSimplex.\u03b4_comp_yonedaEquiv_symm, hx, Equiv.symm_apply_apply]\n cases n with\n | zero =>\n -- A one-dimensional horn is a single vertex, filled by its degenerate edge.\n obtain rfl | rfl := Fin.exists_fin_two.mp \u27e8i, rfl\u27e9\n \u00b7 refine \u27e8X.\u03c3 0 (yonedaEquiv (f 1 (by decide))), fun j hj => ?_\u27e9\n obtain rfl | rfl := Fin.exists_fin_two.mp \u27e8j, rfl\u27e9\n \u00b7 exact absurd rfl hj\n \u00b7 exact \u03b4_comp_\u03c3_succ_apply 0 _\n \u00b7 refine \u27e8X.\u03c3 0 (yonedaEquiv (f 0 (by decide))), fun j hj => ?_\u27e9\n obtain rfl | rfl := Fin.exists_fin_two.mp \u27e8j, rfl\u27e9\n \u00b7 exact \u03b4_comp_\u03c3_self_apply 0 _\n \u00b7 exact absurd rfl hj\n | succ m =>\n refine exists_\u03b4_eq_of_group hX (fun j k hj hk hjk => ?_)\n have := congrArg yonedaEquiv (hf.\u03b4_pred_comp j k hj hk hjk)\n rwa [stdSimplex.yonedaEquiv_\u03b4_comp, stdSimplex.yonedaEquiv_\u03b4_comp] at this", "proof_lines": 22, "proof_length": 886, "rev": "75c8aed5fea63047615a25a9763fd5b68a86e891", "heartbeats": 982, "image": "lean-compression:tauceti-75c8aed5fe-a608030cfc", "split": "dev"} {"path": "TauCeti/Order/Interval/Finite.lean", "module": "TauCeti.Order.Interval.Finite", "theorem": "Set.Finite.exists_strictMono_notMem_inter_Icc_eq_singleton", "prefix": "/-\nCopyright (c) 2026 The Tau Ceti contributors. All rights reserved.\nReleased under Apache 2.0 license as described in the file LICENSE.\nAuthors: The Tau Ceti contributors\n-/\nmodule\n\npublic import Mathlib.Data.Set.Finite.Lattice\nimport Mathlib.Data.Finset.Sort\nimport Mathlib.Data.Set.Finite.Lemmas\n\n/-!\n# Intervals avoiding a finite set of points\n\nA finite family of points of a nonempty preorder without a maximal element misses a nonempty open\ninterval. In a linear order, a set meeting an open interval `(a, b)` in a finite set has no points\naccumulating at `a` from the right: its points above `a` are bounded below by some `c > a`\n(`TauCeti.exists_lt_forall_le_of_finite_inter_Ioo`).\n\nA finite set of points cuts every closed interval of a linear order into finitely many closed\npieces whose interiors avoid it. `TauCeti.Icc_induction_of_disjoint_Ioo` proves a two-endpoint\nproperty of closed intervals by checking it on such pieces and gluing at shared endpoints.\n\nBetween two points `a\u2080 < a\u2081` of a finite set `C` in a linear order, the points of `C \u2229 [a\u2080, a\u2081]`\ncan be listed in increasing order `a\u2080 = d 0 < \u22ef < d (m + 1) = a\u2081`, with no point of `C` between\ntwo consecutive ones (`Set.Finite.exists_strictMono_fin_consecutive`). In a densely ordered linear\norder there is also a finite version with exactly one point of `C` in each band: points\n`b 0 < \u22ef < b m` chosen strictly between consecutive points of `C \u2229 [a\u2080, a\u2081]` avoid `C`, and\n`[a\u2080, b 0]`, each `[b i, b (i + 1)]` and `[b m, a\u2081]` contain exactly one point of `C`\n(`Set.Finite.exists_strictMono_notMem_inter_Icc_eq_singleton`).\n-/\n\npublic section\n\nopen Set\n\nnamespace TauCeti\n\n/-- There is a nonempty open interval avoiding a finite family of points in a nonempty preorder\nwithout a maximal element. -/\ntheorem exists_Ioo_disjoint_range_of_finite {\u03b1 \u03b9 : Type*} [Preorder \u03b1] [Nonempty \u03b1]\n [NoMaxOrder \u03b1] [Finite \u03b9] (a : \u03b9 \u2192 \u03b1) :\n \u2203 p q x : \u03b1, (\u2200 i, a i \u2209 Ioo p q) \u2227 x \u2208 Ioo p q := by\n obtain \u27e8f, hf\u27e9 := Nat.exists_strictMono \u03b1\n -- Each point lies in `Ioo (f n) (f (n + 2))` for at most two consecutive indices `n`.\n have hfin (i : \u03b9) : {n : \u2115 | a i \u2208 Ioo (f n) (f (n + 2))}.Finite := by\n rcases {n : \u2115 | a i \u2208 Ioo (f n) (f (n + 2))}.eq_empty_or_nonempty with h | \u27e8n\u2080, hn\u2080\u27e9\n \u00b7 rw [h]\n exact Set.finite_empty\n refine (Set.finite_le_nat (n\u2080 + 1)).subset fun m hm => ?_\n by_contra hlt\n exact (hn\u2080.2.trans_le (hf.monotone (Nat.succ_le_of_lt (not_le.1 hlt)))).not_gt hm.1\n obtain \u27e8n, hn\u27e9 := (Set.finite_iUnion hfin).exists_notMem\n simp only [Set.mem_iUnion, not_exists] at hn\n exact \u27e8f n, f (n + 2), f (n + 1), hn, hf (Nat.lt_succ_self n), hf (Nat.lt_succ_self (n + 1))\u27e9\n\n/-- If a set `S` in a linear order meets some nonempty open interval `(a, b)` in a finite set,\nthen the points of `S` above `a` are bounded below by some `c > a`: take for `c` the least\nelement of `(S \u2229 (a, b)) \u222a {b}`. -/\ntheorem exists_lt_forall_le_of_finite_inter_Ioo {\u03b1 : Type*} [LinearOrder \u03b1] {S : Set \u03b1}\n {a b : \u03b1} (hab : a < b) (hS : (S \u2229 Ioo a b).Finite) :\n \u2203 c, a < c \u2227 \u2200 x \u2208 S, a < x \u2192 c \u2264 x := by\n obtain \u27e8c, hc, hmin\u27e9 := Set.exists_min_image _ id (hS.insert b) (Set.insert_nonempty _ _)\n refine \u27e8c, ?_, fun x hx hax \u21a6 ?_\u27e9\n \u00b7 rcases hc with rfl | hc\n exacts [hab, hc.2.1]\n \u00b7 rcases lt_or_ge x b with hxb | hbx\n \u00b7 exact hmin x (Or.inr \u27e8hx, hax, hxb\u27e9)\n \u00b7 exact (hmin b (Or.inl rfl)).trans hbx\n\n/-- **Induction over closed intervals cut by a finite set.** Let `Q c d` be a property of the\nendpoints of closed intervals `[c, d]` contained in `s`. If `Q` holds on every such interval\nwhose interior avoids the finite set `p`, and `Q` is preserved by concatenation at a shared\nendpoint inside `s`, then `Q` holds on every closed interval contained in `s`. -/\ntheorem Icc_induction_of_disjoint_Ioo {\u03b1 : Type*} [LinearOrder \u03b1] {p : Finset \u03b1} {s : Set \u03b1}\n {Q : \u03b1 \u2192 \u03b1 \u2192 Prop}\n (hbase : \u2200 c d : \u03b1, c \u2264 d \u2192 Icc c d \u2286 s \u2192 Disjoint (\u2191p : Set \u03b1) (Ioo c d) \u2192 Q c d)\n (hglue : \u2200 c m d : \u03b1, c \u2264 m \u2192 m \u2264 d \u2192 Icc c d \u2286 s \u2192 Q c m \u2192 Q m d \u2192 Q c d) {c d : \u03b1}\n (hcd : c \u2264 d) (hs : Icc c d \u2286 s) : Q c d := by\n -- Induct on `p`: a new point `m` inside `(c, d)` splits `[c, d]` into `[c, m]` and `[m, d]`.\n induction p using Finset.induction_on generalizing c d with\n | empty => exact hbase c d hcd hs (by simp)\n | insert m p _ ih =>\n refine ih (fun c d hcd hs hdisj => ?_) hcd hs\n simp only [Finset.coe_insert, disjoint_insert_left] at hbase\n by_cases hm : m \u2208 Ioo c d\n \u00b7 exact hglue c m d hm.1.le hm.2.le hs\n (hbase c m hm.1.le ((Icc_subset_Icc_right hm.2.le).trans hs)\n \u27e8by simp, hdisj.mono_right (Ioo_subset_Ioo_right hm.2.le)\u27e9)\n (hbase m d hm.2.le ((Icc_subset_Icc_left hm.1.le).trans hs)\n \u27e8by simp, hdisj.mono_right (Ioo_subset_Ioo_left hm.1.le)\u27e9)\n \u00b7 exact hbase c d hcd hs \u27e8hm, hdisj\u27e9\n\nend TauCeti\n\n/-- **Listing the points of a finite set between two of its points.** Let `C` be a finite subset\nof a linear order and let `a\u2080 < a\u2081` be two of its points. The points of `C` in `[a\u2080, a\u2081]` can\nbe listed in increasing order `a\u2080 = d 0 < d 1 < \u22ef < d (m + 1) = a\u2081`, and no point of `C` lies\nstrictly between two consecutive ones. -/\ntheorem Set.Finite.exists_strictMono_fin_consecutive {\u03b1 : Type*} [LinearOrder \u03b1] {C : Set \u03b1}\n (hC : C.Finite) {a\u2080 a\u2081 : \u03b1} (h\u2080 : a\u2080 \u2208 C) (h\u2081 : a\u2081 \u2208 C) (h : a\u2080 < a\u2081) :\n \u2203 m : \u2115, \u2203 d : Fin (m + 2) \u2192 \u03b1, StrictMono d \u2227 (\u2200 j, d j \u2208 C) \u2227 d 0 = a\u2080 \u2227\n d (Fin.last (m + 1)) = a\u2081 \u2227\n \u2200 (i : Fin (m + 1)) {x : \u03b1}, x \u2208 C \u2192 d i.castSucc < x \u2192 x < d i.succ \u2192 False := by\n set s := (hC.inter_of_left (Icc a\u2080 a\u2081)).toFinset with hs\n have hmem {x : \u03b1} : x \u2208 s \u2194 x \u2208 C \u2227 x \u2208 Icc a\u2080 a\u2081 := by simp [hs]\n have hcard : 2 \u2264 s.card := by\n have hsub : ({a\u2080, a\u2081} : Finset \u03b1) \u2286 s := by\n intro x hx\n rcases Finset.mem_insert.1 hx with rfl | hx\n \u00b7 exact hmem.2 \u27e8h\u2080, le_rfl, h.le\u27e9\n \u00b7 rw [Finset.mem_singleton.1 hx]\n exact hmem.2 \u27e8h\u2081, h.le, le_rfl\u27e9\n simpa [Finset.card_pair h.ne] using Finset.card_le_card hsub\n obtain \u27e8m, hm\u27e9 : \u2203 m, s.card = m + 2 := \u27e8s.card - 2, by omega\u27e9\n set d := s.orderEmbOfFin hm\n have hdI (j : Fin (m + 2)) : d j \u2208 Icc a\u2080 a\u2081 := (hmem.1 (s.orderEmbOfFin_mem hm j)).2\n -- Every point of `C` in `[a\u2080, a\u2081]` is some `d j`.\n have hd {x : \u03b1} (hx : x \u2208 C) (hxI : x \u2208 Icc a\u2080 a\u2081) : \u2203 j, d j = x := by\n have hx' : x \u2208 Set.range d := by\n rw [Finset.range_orderEmbOfFin]\n exact Finset.mem_coe.2 (hmem.2 \u27e8hx, hxI\u27e9)\n exact Set.mem_range.1 hx'\n refine \u27e8m, d, d.strictMono, fun j \u21a6 (hmem.1 (s.orderEmbOfFin_mem hm j)).1, ?_, ?_,\n fun i x hx hx\u2081 hx\u2082 \u21a6 ?_\u27e9\n \u00b7 obtain \u27e8j, hj\u27e9 := hd h\u2080 \u27e8le_rfl, h.le\u27e9\n exact le_antisymm (hj \u25b8 d.monotone (Fin.zero_le j)) (hdI 0).1\n \u00b7 obtain \u27e8j, hj\u27e9 := hd h\u2081 \u27e8h.le, le_rfl\u27e9\n exact le_antisymm (hdI _).2 (hj \u25b8 d.monotone (Fin.le_last j))\n \u00b7 obtain \u27e8j, rfl\u27e9 := hd hx \u27e8(hdI _).1.trans hx\u2081.le, hx\u2082.le.trans (hdI _).2\u27e9\n have h\u2081 := d.lt_iff_lt.1 hx\u2081\n have h\u2082 := d.lt_iff_lt.1 hx\u2082\n rw [Fin.lt_def, Fin.val_castSucc] at h\u2081\n rw [Fin.lt_def, Fin.val_succ] at h\u2082\n omega\n\n", "statement": "/-- **Finitely many points separating a finite set between two of its points.** Let `C` be a\nfinite subset of a densely ordered linear order and let `a\u2080 < a\u2081` be two of its points. There are\nstrictly increasing points `b 0 < \u22ef < b m` in `(a\u2080, a\u2081)`, none of them in `C`, such that `a\u2080`\nis the only point of `C` in `[a\u2080, b 0]`, `a\u2081` is the only point of `C` in `[b m, a\u2081]`, and each\n`[b i, b (i + 1)]` contains exactly one point of `C`. -/\ntheorem Set.Finite.exists_strictMono_notMem_inter_Icc_eq_singleton {\u03b1 : Type*} [LinearOrder \u03b1]\n [DenselyOrdered \u03b1] {C : Set \u03b1} (hC : C.Finite) {a\u2080 a\u2081 : \u03b1} (h\u2080 : a\u2080 \u2208 C) (h\u2081 : a\u2081 \u2208 C)\n (h : a\u2080 < a\u2081) :\n \u2203 m : \u2115, \u2203 b : Fin (m + 1) \u2192 \u03b1, StrictMono b \u2227 (\u2200 i, b i \u2209 C) \u2227 a\u2080 < b 0 \u2227\n b (Fin.last m) < a\u2081 \u2227 C \u2229 Icc a\u2080 (b 0) = {a\u2080} \u2227 C \u2229 Icc (b (Fin.last m)) a\u2081 = {a\u2081} \u2227\n \u2200 i : Fin m, \u2203 c, C \u2229 Icc (b i.castSucc) (b i.succ) = {c} ", "proof": " by\n -- The points of `C` in `[a\u2080, a\u2081]`, in increasing order `a\u2080 = d 0 < d 1 < \u22ef < d (m + 1) = a\u2081`.\n obtain \u27e8m, d, hdm, hdC, hd0, hdl, hgap\u27e9 := hC.exists_strictMono_fin_consecutive h\u2080 h\u2081 h\n -- `b i` lies strictly between `d i` and `d (i + 1)`.\n choose b hbl hbu using fun i : Fin (m + 1) \u21a6 exists_between (hdm (Fin.castSucc_lt_succ (i := i)))\n have hb0 : a\u2080 < b 0 := by simpa [hd0] using hbl 0\n have hbm : b (Fin.last m) < a\u2081 := by simpa [hdl] using hbu (Fin.last m)\n -- `d (i + 1)` lies strictly between `b i` and `b (i + 1)`.\n have hbd (i : Fin m) : b i.castSucc < d i.succ.castSucc \u2227 d i.succ.castSucc < b i.succ :=\n \u27e8Fin.succ_castSucc i \u25b8 hbu i.castSucc, hbl i.succ\u27e9\n refine \u27e8m, b, Fin.strictMono_iff_lt_succ.2 fun i \u21a6 ?_, fun i hi \u21a6 hgap i hi (hbl i) (hbu i),\n hb0, hbm, ?_, ?_, fun i \u21a6 ?_\u27e9\n \u00b7 exact (hbd i).1.trans (hbd i).2\n \u00b7 refine Set.eq_singleton_iff_unique_mem.2 \u27e8\u27e8h\u2080, le_rfl, hb0.le\u27e9, fun x \u27e8hx, hx\u2081, hx\u2082\u27e9 \u21a6 ?_\u27e9\n by_contra hne\n exact hgap 0 hx (by simpa [hd0] using lt_of_le_of_ne hx\u2081 (Ne.symm hne))\n (hx\u2082.trans_lt (hbu 0))\n \u00b7 refine Set.eq_singleton_iff_unique_mem.2 \u27e8\u27e8h\u2081, hbm.le, le_rfl\u27e9, fun x \u27e8hx, hx\u2081, hx\u2082\u27e9 \u21a6 ?_\u27e9\n by_contra hne\n exact hgap (Fin.last m) hx ((hbl _).trans_le hx\u2081)\n (by simpa [hdl] using lt_of_le_of_ne hx\u2082 hne)\n \u00b7 -- The only point of `C` in `[b i, b (i + 1)]` is `d (i + 1)`.\n refine \u27e8d i.succ.castSucc, Set.eq_singleton_iff_unique_mem.2\n \u27e8\u27e8hdC _, (hbd i).1.le, (hbd i).2.le\u27e9, fun x \u27e8hx, hx\u2081, hx\u2082\u27e9 \u21a6 ?_\u27e9\u27e9\n rcases lt_trichotomy x (d i.succ.castSucc) with hlt' | heq | hgt\n \u00b7 exact (hgap i.castSucc hx ((hbl _).trans_le hx\u2081)\n (by rw [Fin.succ_castSucc]; exact hlt')).elim\n \u00b7 exact heq\n \u00b7 exact (hgap i.succ hx hgt (hx\u2082.trans_lt (hbu _))).elim", "proof_lines": 28, "proof_length": 1373, "rev": "75c8aed5fea63047615a25a9763fd5b68a86e891", "heartbeats": 721, "image": "lean-compression:tauceti-75c8aed5fe-a608030cfc", "split": "dev"} {"path": "TauCeti/Algebra/Category/ModuleCat/Sheaf/FiniteType.lean", "module": "TauCeti.Algebra.Category.ModuleCat.Sheaf.FiniteType", "theorem": "SheafOfModules.isFiniteType_pushforward_of_isLeftAdjoint", "prefix": "/-\nCopyright (c) 2026 The Tau Ceti contributors. All rights reserved.\nReleased under Apache 2.0 license as described in the file LICENSE.\nAuthors: The Tau Ceti contributors\n-/\nmodule\n\npublic import TauCeti.Algebra.Category.ModuleCat.Sheaf.LocallyFree\n\n/-!\n# Finite type is local\n\nA sheaf of modules of finite type is one that is locally generated by finitely many sections.\nThis file shows that this property is invariant under isomorphism, that it can be checked on a\ncovering family, that it is preserved by pushforward along a continuous and cocontinuous left\nadjoint with an isomorphism of structure sheaves, and that it is closed under tensor products. The\npushforward statement is the finite-type analogue of Mathlib's\n`SheafOfModules.isQuasicoherent_pushforward_of_isLeftAdjoint`, carrying local generators the way\n`SheafOfModules.QuasicoherentData.pushforward` carries presentations. Closure under tensor products\nsimilarly pairs local generators on a common refinement, mirroring\n`SheafOfModules.QuasicoherentData.tensor`.\n\n## Main declarations\n\n* `SheafOfModules.LocalGeneratorsData.isFiniteType`: finite-type local generators, indexed in\n any universe, make a sheaf of modules of finite type.\n* `SheafOfModules.IsFiniteType.of_iso`: finite type is invariant under isomorphism.\n* `SheafOfModules.IsFiniteType.of_coversTop`: finite type can be checked on a covering family.\n* `SheafOfModules.LocalGeneratorsData.pushforward`: local generators carried along a continuous\n and cocontinuous functor.\n* `SheafOfModules.isFiniteType_pushforward_of_isLeftAdjoint`: pushforward along a left adjoint\n continuous functor preserves finite type.\n* `SheafOfModules.LocalGeneratorsData.tensor`: local generators for `M \u2297 N` built from local\n generators for `M` and for `N` on a common refinement.\n* `SheafOfModules.isFiniteType_tensorObj`: the tensor product of two sheaves of modules of finite\n type is of finite type.\n-/\n\npublic section\n\nopen CategoryTheory Limits\n\nuniverse u v\u2081 v\u2082 u\u2081 u\u2082\n\nnamespace SheafOfModules\n\nsection Locality\n\nvariable {C : Type u\u2081} [Category.{v\u2081} C] {J : GrothendieckTopology C} {R : Sheaf J RingCat.{u}}\n [\u2200 X, HasWeakSheafify (J.over X) AddCommGrpCat.{u}]\n [\u2200 X, (J.over X).WEqualsLocallyBijective AddCommGrpCat.{u}]\n\n/-- Shrinking the covering family of local generators keeps each selected family of generators,\nso finite type is preserved. -/\ninstance LocalGeneratorsData.isFiniteType_shrink\n {M : SheafOfModules.{u} R} (q : M.LocalGeneratorsData) [q.IsFiniteType] :\n q.shrink.IsFiniteType where\n isFiniteType i := LocalGeneratorsData.IsFiniteType.isFiniteType (p := q) i.property.choose\n\n/-- A sheaf of modules with finite-type local generators, indexed in any universe, is of finite\ntype. -/\ntheorem LocalGeneratorsData.isFiniteType {M : SheafOfModules.{u} R}\n (q : M.LocalGeneratorsData) [q.IsFiniteType] : M.IsFiniteType :=\n \u27e8q.shrink, inferInstance\u27e9\n\n/-- Finite type is invariant under isomorphism. -/\ntheorem IsFiniteType.of_iso {M N : SheafOfModules.{u} R} (e : M \u2245 N)\n [M.IsFiniteType] : N.IsFiniteType := by\n obtain \u27e8q, _\u27e9 := IsFiniteType.exists_localGeneratorsData M\n exact (q.ofIsIso e.hom).isFiniteType\n\nvariable [\u2200 X, HasSheafify (J.over X) AddCommGrpCat.{u}]\n [\u2200 X Y, HasWeakSheafify ((J.over X).over Y) AddCommGrpCat.{u}]\n [\u2200 X Y, ((J.over X).over Y).WEqualsLocallyBijective AddCommGrpCat.{u}]\n\n/-- If a sheaf of modules is of finite type after restriction to every member of a covering\nfamily, then it is of finite type. -/\ntheorem IsFiniteType.of_coversTop {M : SheafOfModules.{u} R} {I : Type*}\n (X : I \u2192 C) (hX : J.CoversTop X) [\u2200 i, (M.over (X i)).IsFiniteType] : M.IsFiniteType := by\n have h : \u2200 i, \u2203 D : (M.over (X i)).LocalGeneratorsData, D.IsFiniteType := fun i \u21a6\n IsFiniteType.exists_localGeneratorsData (M.over (X i))\n choose D hD using h\n exact (LocalGeneratorsData.bind X hX D).isFiniteType\n\nend Locality\n\nsection map\n\nvariable {C : Type u\u2081} [Category.{v\u2081} C] {J : GrothendieckTopology C} {R : Sheaf J RingCat.{u}}\n {D : Type u\u2082} [Category.{v\u2082} D] {K : GrothendieckTopology D}\n {S : Sheaf K RingCat.{u}} [\u2200 (X : D), (K.over X).WEqualsLocallyBijective AddCommGrpCat]\n [\u2200 X, (J.over X).WEqualsLocallyBijective AddCommGrpCat.{u}]\n [\u2200 (X : C), HasSheafify (J.over X) AddCommGrpCat.{u}]\n [\u2200 (X : D), HasSheafify (K.over X) AddCommGrpCat.{u}]\n (G : D \u2964 C) [G.IsContinuous K J] [G.IsCocontinuous K J]\n (\u03c6 : S \u27f6 (G.sheafPushforwardContinuous RingCat.{u} K J).obj R)\n\n/-- Local generators of `M`, carried along a continuous and cocontinuous functor `G` to local\ngenerators of the pushforward of `M`: the cover is formed by the objects of `D` whose image maps\nto a member of the original cover, and the generators are carried as in\n`SheafOfModules.QuasicoherentData.pushforward`. -/\nnoncomputable def LocalGeneratorsData.pushforward\n (\u03b7 : (SheafOfModules.pushforward \u03c6).obj (unit R) \u2245 unit S)\n [\u2200 (X : D), (Over.post G).IsContinuous (K.over X) (J.over _)]\n (h : \u2200 (X : D) (Y : C) (f : G.obj X \u27f6 Y),\n PreservesColimitsOfSize.{u, u} <|\n SheafOfModules.pushforward.{u} (R := (R.over Y))\n (F := Over.post (X := X) G \u22d9 Over.map f)\n (((Over.forget X).sheafPushforwardContinuous RingCat.{u} (K.over X) K).map \u03c6))\n {M : SheafOfModules.{u} R} (P : LocalGeneratorsData M) :\n LocalGeneratorsData ((SheafOfModules.pushforward \u03c6).obj M) where\n I := \u03a3 (X : D) (i : P.I), G.obj X \u27f6 P.X i\n X i := i.1\n coversTop Y := by\n refine K.superset_covering ?_ <| G.cover_lift K _ (P.coversTop (G.obj Y))\n intro Z g \u27e8i, \u27e8v\u27e9\u27e9\n exact \u27e8\u27e8Z, i, v\u27e9, \u27e8\ud835\udfd9 _\u27e9\u27e9\n generators i := by\n letI overS : SheafOfModules.{u} S \u2964 SheafOfModules.{u} (S.over i.1) :=\n SheafOfModules.pushforward (\ud835\udfd9 _)\n letI G' := Over.post (X := i.1) G \u22d9 Over.map i.2.2\n letI \u03c8 : S.over i.1 \u27f6\n (G'.sheafPushforwardContinuous RingCat.{u} (K.over i.1) (J.over (P.X i.2.1))).obj\n (R.over (P.X i.2.1)) :=\n ((Over.forget i.1).sheafPushforwardContinuous RingCat.{u} (K.over i.1) K).map \u03c6\n letI e : (SheafOfModules.pushforward \u03c8).obj (unit (R.over (P.X i.snd.fst))) \u2245\n unit (S.over i.fst) := overS.mapIso \u03b7\n haveI : PreservesColimitsOfSize.{u, u, _} (SheafOfModules.pushforward \u03c8) := h _ _ _\n exact (P.generators i.2.1).map (SheafOfModules.pushforward \u03c8) e.symm\n\n/-- Carrying local generators along `G` indexes the cover by an object of `D`, a member of the\noriginal cover, and a morphism from the image of the former to the latter. -/\n@[simp]\ntheorem LocalGeneratorsData.pushforward_I\n (\u03b7 : (SheafOfModules.pushforward \u03c6).obj (unit R) \u2245 unit S)\n [\u2200 (X : D), (Over.post G).IsContinuous (K.over X) (J.over _)]\n (h : \u2200 (X : D) (Y : C) (f : G.obj X \u27f6 Y),\n PreservesColimitsOfSize.{u, u} <|\n SheafOfModules.pushforward.{u} (R := (R.over Y))\n (F := Over.post (X := X) G \u22d9 Over.map f)\n (((Over.forget X).sheafPushforwardContinuous RingCat.{u} (K.over X) K).map \u03c6))\n {M : SheafOfModules.{u} R} (P : LocalGeneratorsData M) :\n (P.pushforward G \u03c6 \u03b7 h).I = \u03a3 (X : D) (i : P.I), G.obj X \u27f6 P.X i :=\n (rfl)\n\n/-- The covering objects of carried local generators are the objects of `D` indexing them. -/\n@[simp]\ntheorem LocalGeneratorsData.pushforward_X\n (\u03b7 : (SheafOfModules.pushforward \u03c6).obj (unit R) \u2245 unit S)\n [\u2200 (X : D), (Over.post G).IsContinuous (K.over X) (J.over _)]\n (h : \u2200 (X : D) (Y : C) (f : G.obj X \u27f6 Y),\n PreservesColimitsOfSize.{u, u} <|\n SheafOfModules.pushforward.{u} (R := (R.over Y))\n (F := Over.post (X := X) G \u22d9 Over.map f)\n (((Over.forget X).sheafPushforwardContinuous RingCat.{u} (K.over X) K).map \u03c6))\n {M : SheafOfModules.{u} R} (P : LocalGeneratorsData M) :\n (P.pushforward G \u03c6 \u03b7 h).X = fun i \u21a6\n ((LocalGeneratorsData.pushforward_I G \u03c6 \u03b7 h P).mp i).1 :=\n (rfl)\n\n/-- The generators of carried local generators are the original generators on the target of the\nindexing morphism, mapped along the pushforward of modules on the slices. -/\n@[simp]\ntheorem LocalGeneratorsData.pushforward_generators\n (\u03b7 : (SheafOfModules.pushforward \u03c6).obj (unit R) \u2245 unit S)\n [\u2200 (X : D), (Over.post G).IsContinuous (K.over X) (J.over _)]\n (h : \u2200 (X : D) (Y : C) (f : G.obj X \u27f6 Y),\n PreservesColimitsOfSize.{u, u} <|\n SheafOfModules.pushforward.{u} (R := (R.over Y))\n (F := Over.post (X := X) G \u22d9 Over.map f)\n (((Over.forget X).sheafPushforwardContinuous RingCat.{u} (K.over X) K).map \u03c6))\n {M : SheafOfModules.{u} R} (P : LocalGeneratorsData M)\n (i : (P.pushforward G \u03c6 \u03b7 h).I) :\n (P.pushforward G \u03c6 \u03b7 h).generators i =\n cast (by rw [LocalGeneratorsData.pushforward_X]; rfl)\n (letI j := (LocalGeneratorsData.pushforward_I G \u03c6 \u03b7 h P).mp i\n letI overS : SheafOfModules.{u} S \u2964 SheafOfModules.{u} (S.over j.1) :=\n SheafOfModules.pushforward (\ud835\udfd9 _)\n letI \u03c8 : S.over j.1 \u27f6\n ((Over.post (X := j.1) G \u22d9 Over.map j.2.2).sheafPushforwardContinuous RingCat.{u}\n (K.over j.1) (J.over (P.X j.2.1))).obj (R.over (P.X j.2.1)) :=\n ((Over.forget j.1).sheafPushforwardContinuous RingCat.{u} (K.over j.1) K).map \u03c6\n haveI : PreservesColimitsOfSize.{u, u, _} (SheafOfModules.pushforward \u03c8) := h _ _ _\n (P.generators j.2.1).map (SheafOfModules.pushforward \u03c8) (overS.mapIso \u03b7).symm) :=\n (rfl)\n\n/-- Carrying local generators along a continuous and cocontinuous functor preserves finiteness. -/\ninstance LocalGeneratorsData.isFiniteType_pushforward\n (\u03b7 : (SheafOfModules.pushforward \u03c6).obj (unit R) \u2245 unit S)\n [\u2200 (X : D), (Over.post G).IsContinuous (K.over X) (J.over _)]\n (h : \u2200 (X : D) (Y : C) (f : G.obj X \u27f6 Y),\n PreservesColimitsOfSize.{u, u} <|\n SheafOfModules.pushforward.{u} (R := (R.over Y))\n (F := Over.post (X := X) G \u22d9 Over.map f)\n (((Over.forget X).sheafPushforwardContinuous RingCat.{u} (K.over X) K).map \u03c6))\n {M : SheafOfModules.{u} R} (P : LocalGeneratorsData M)\n [P.IsFiniteType] : (P.pushforward G \u03c6 \u03b7 h).IsFiniteType where\n isFiniteType i :=\n let _ := LocalGeneratorsData.IsFiniteType.isFiniteType (p := P) i.2.1\n \u27e8GeneratingSections.IsFiniteType.finite (\u03c3 := P.generators i.2.1)\u27e9\n\n", "statement": "/-- The pushforward of a module of finite type along a left adjoint continuous functor, with an\nisomorphism of structure sheaves, is of finite type. -/\ntheorem isFiniteType_pushforward_of_isLeftAdjoint\n (\u03b7 : (pushforward \u03c6).obj (unit R) \u2245 unit S)\n [G.IsLeftAdjoint] [h\u03c6 : IsIso \u03c6]\n [hG : \u2200 X, Functor.IsContinuous (Over.post (X := X) G) (K.over _) (J.over _)]\n [HasPullbacks C] [HasPullbacks D]\n {M : SheafOfModules.{u} R} [hM : M.IsFiniteType] :\n ((pushforward \u03c6).obj M).IsFiniteType ", "proof": " by\n obtain \u27e8P, _\u27e9 := IsFiniteType.exists_localGeneratorsData M\n refine (P.pushforward G \u03c6 \u03b7 fun X Y f \u21a6 ?_).isFiniteType\n let G' := Over.post (X := X) G \u22d9 Over.map f\n have : G'.IsContinuous (K.over X) (J.over Y) := Functor.isContinuous_comp _ _ _ (J.over _) _\n have : G'.IsCocontinuous (K.over X) (J.over Y) := isCocontinuous_comp _ _ _ (J.over _)\n let a : S.over X \u27f6\n (G'.sheafPushforwardContinuous RingCat.{u} (K.over X) (J.over Y)).obj (R.over Y) :=\n ((Over.forget X).sheafPushforwardContinuous RingCat.{u} (K.over X) K).map \u03c6\n have : IsIso a := Functor.map_isIso _ \u03c6\n have : (pushforward.{u} a).IsLeftAdjoint := isLeftAdjoint_pushforward_of_isIso a\n infer_instance", "proof_lines": 11, "proof_length": 657, "rev": "75c8aed5fea63047615a25a9763fd5b68a86e891", "heartbeats": 1221, "image": "lean-compression:tauceti-75c8aed5fe-a608030cfc", "split": "dev"} {"path": "TauCeti/Algebra/Algebra/Subalgebra/Nilpotent.lean", "module": "TauCeti.Algebra.Algebra.Subalgebra.Nilpotent", "theorem": "Subalgebra.pow_le_toSubmodule_sup_pow_succ", "prefix": "/-\nCopyright (c) 2026 The Tau Ceti contributors. All rights reserved.\nReleased under Apache 2.0 license as described in the file LICENSE.\nAuthors: The Tau Ceti contributors\n-/\nmodule\n\npublic import Mathlib.Algebra.Algebra.Subalgebra.Lattice\npublic import Mathlib.RingTheory.Ideal.Quotient.Operations\n\n/-!\n# Generating an algebra modulo a nilpotent ideal\n\nLet `S` be a subalgebra of `A` and `I` a nilpotent ideal. If `S` maps onto `A/I` and contains\nrepresentatives spanning `I/I\u00b2`, then `S = A`. Thus algebra generators can be lifted from the\nquotient and the first ideal layer; this is the step showing that lifts of vertex idempotents and\nof a basis of the first radical layer generate a finite-dimensional basic algebra over an\nalgebraically closed field.\n\nThe intermediate power estimate records that products of these first-layer lifts span every\nsuccessive ideal layer. No commutativity of `A`, field hypothesis, or finite-dimensionality is\nneeded for the nilpotent-ideal criterion, and `I` need only be a left ideal.\n\n`AlgHom.surjective_of_nilpotent_ideal` is the corresponding criterion for an algebra map:\nsurjectivity modulo `I` and spanning the first ideal layer imply surjectivity. For the radical\nof an Artinian algebra, Mathlib's `IsArtinianRing.isNilpotent_jacobson` supplies nilpotence.\n\n## References\n\n* I. Assem, D. Simson, A. Skowro\u0144ski, *Elements of the Representation Theory of Associative\n Algebras I*, Chapter II, \u00a73 (the generation step in the bound-quiver presentation).\n-/\n\npublic section\n\nnamespace Subalgebra\n\nvariable {R A : Type*} [CommSemiring R] [Ring A] [Algebra R A]\n\n", "statement": "/-- If a subalgebra contains representatives of the first ideal layer, it contains\nrepresentatives of every positive ideal layer. -/\ntheorem pow_le_toSubmodule_sup_pow_succ (S : Subalgebra R A) (I : Ideal A)\n (h : I.restrictScalars R \u2264 S.toSubmodule \u2294 (I ^ 2).restrictScalars R)\n (n : \u2115) (hn : n \u2260 0) :\n (I ^ n).restrictScalars R \u2264 S.toSubmodule \u2294 (I ^ (n + 1)).restrictScalars R ", "proof": " by\n obtain \u27e8m, rfl\u27e9 := Nat.exists_eq_succ_of_ne_zero hn\n rw [Submodule.restrictScalars_pow two_ne_zero] at h\n rw [Submodule.restrictScalars_pow m.succ_ne_zero,\n Submodule.restrictScalars_pow (m + 1).succ_ne_zero]\n set N := I.restrictScalars R\n set P := N \u2293 S.toSubmodule\n have hsq : N ^ 2 \u2264 N := by\n rw [sq]\n exact Submodule.mul_le.mpr fun x _ y hy \u21a6 I.mul_mem_left x hy\n -- The chosen representatives can be taken inside the ideal, since the error lies in its square.\n have hNP : N \u2264 P \u2294 N ^ 2 := fun x hx \u21a6 by\n obtain \u27e8b, hb, c, hc, rfl\u27e9 := Submodule.mem_sup.mp (h hx)\n exact Submodule.mem_sup.mpr\n \u27e8b, Submodule.mem_inf.mpr \u27e8(I.add_mem_iff_left (hsq hc)).mp hx, hb\u27e9, c, hc, rfl\u27e9\n have hP (m : \u2115) : P ^ m \u2264 S.toSubmodule := by\n induction m with\n | zero => exact Submodule.one_le.mpr S.one_mem\n | succ m ih =>\n rw [pow_succ]\n exact Submodule.mul_le.mpr fun x hx y hy \u21a6 S.mul_mem (ih hx) hy.2\n -- Replace one factor at a time; every error belongs to the next ideal power.\n have hlayer : \u2200 m : \u2115, N ^ (m + 1) \u2264 P ^ (m + 1) \u2294 N ^ (m + 2) := by\n intro m\n induction m with\n | zero => simpa only [Nat.zero_add, pow_one] using hNP\n | succ m ih =>\n calc\n N ^ (m + 1 + 1) \u2264 (P ^ (m + 1) \u2294 N ^ (m + 2)) * N := by\n rw [pow_succ]\n exact mul_le_mul_left ih N\n _ = P ^ (m + 1) * N \u2294 N ^ (m + 3) := by\n rw [Submodule.sup_mul, \u2190 pow_succ]\n _ \u2264 P ^ (m + 1) * (P \u2294 N ^ 2) \u2294 N ^ (m + 3) :=\n sup_le_sup (mul_le_mul_right hNP _) le_rfl\n _ = P ^ (m + 2) \u2294 P ^ (m + 1) * N ^ 2 \u2294 N ^ (m + 3) := by\n rw [Submodule.mul_sup, \u2190 pow_succ]\n _ \u2264 P ^ (m + 2) \u2294 N ^ (m + 3) := by\n refine sup_le (sup_le le_sup_left ?_) le_sup_right\n exact (mul_le_mul_left (pow_le_pow_left' inf_le_left (m + 1)) _).trans\n (by rw [\u2190 pow_add]; exact le_sup_right)\n exact (hlayer m).trans (sup_le_sup_right (hP _) _)", "proof_lines": 41, "proof_length": 1548, "rev": "75c8aed5fea63047615a25a9763fd5b68a86e891", "heartbeats": 2737, "image": "lean-compression:tauceti-75c8aed5fe-a608030cfc", "split": "dev"} {"path": "TauCeti/RingTheory/DividedPowers/RootString/G2/Basic.lean", "module": "TauCeti.RingTheory.DividedPowers.RootString.G2.Basic", "theorem": "TauCeti.Associative.commutator_eq_three_nsmul_of_commute", "prefix": "/-\nCopyright (c) 2026 The Tau Ceti contributors. All rights reserved.\nReleased under Apache 2.0 license as described in the file LICENSE.\nAuthors: Claude\n-/\nmodule\n\npublic import TauCeti.RingTheory.DividedPowers.RootString.Basic\n\n/-!\n# Normal ordering divided powers along the type-`G\u2082` root string\n\nLet `x`, `y`, `z`, `w`, `v`, and `s` belong to an associative algebra over `\u211a`, with\n\n```text\nx * y = y * x + z, x * z = z * x + 2 \u2022 w, x * w = w * x + 3 \u2022 v, w * z = z * w + 3 \u2022 s,\n```\n\n`v` and `s` commuting with `x`, `y` commuting with `z`, `w` commuting with `v`, and `s` commuting\nwith `z`, `w`, and `v`. This is the situation of the two simple roots of a root system of type `G\u2082`,\n`\u03b1` short and `\u03b2` long: with `x` and `y` the Chevalley root vectors of `\u03b1` and `\u03b2`, the divided\npowers `(ad x)\u1d4f y / k!` of the inner derivation are the root vectors of `\u03b1 + \u03b2`, `2\u03b1 + \u03b2`, and\n`3\u03b1 + \u03b2` up to sign, and `s` is the root vector of `3\u03b1 + 2\u03b2`. Every one of the four brackets above\nis integral.\n\nThe resulting straightening rule is again coefficient-one,\n\n```text\nx\u207d\u1d50\u207e y\u207d\u207f\u207e = \u2211 b + c + d + 2e \u2264 n, b + 2c + 3d + 3e \u2264 m,\n y\u207d\u207f\u207b\u1d47\u207b\u1d9c\u207b\u1d48\u207b\u00b2\u1d49\u207e z\u207d\u1d47\u207e w\u207d\u1d9c\u207e v\u207d\u1d48\u207e s\u207d\u1d49\u207e x\u207d\u1d50\u207b\u1d47\u207b\u00b2\u1d9c\u207b\u00b3\u1d48\u207b\u00b3\u1d49\u207e,\n```\n\nso it holds in a Kostant integral form and, after base change, over a ring of any characteristic.\nThe two exponents attached to a summand are the pair `(i, j)` of the root `i \u03b1 + j \u03b2` it comes from:\n`z` contributes `(1, 1)`, `w` contributes `(2, 1)`, `v` contributes `(3, 1)`, and `s` contributes\n`(3, 2)`. That last root is what makes the type-`G\u2082` case genuinely longer than the chain treated in\n`TauCeti.RingTheory.DividedPowers.RootString.Basic`: `3\u03b1 + 2\u03b2` is not on the `\u03b1`-string through `\u03b2`,\nand it enters through the bracket `w * z = z * w + 3 \u2022 s` rather than through `ad x`.\n\nFor the other nontrivial pair `\u03b1`, `\u03b1 + \u03b2`, the root `3\u03b1 + 2\u03b2` arises instead from\n`\u2045e_(2\u03b1 + \u03b2), e_(\u03b1 + \u03b2)\u2046`. Its divided-power straightening rule is\n`TauCeti.Associative.dividedPower_mul_dividedPower_of_g2_short_pair` in\n`TauCeti.RingTheory.DividedPowers.RootString.G2.ShortPair`.\n\nThe proof feeds `TauCeti.Associative.dividedPower_mul_of_ad_dividedPower_series` the sequence\n\n```text\nd k = \u2211 b + 2c + 3d + 3e = k, y\u207d\u207f\u207b\u1d47\u207b\u1d9c\u207b\u1d48\u207b\u00b2\u1d49\u207e z\u207d\u1d47\u207e w\u207d\u1d9c\u207e v\u207d\u1d48\u207e s\u207d\u1d49\u207e,\n```\n\nwhich is the `k`-th divided power of the inner derivation `ad x` applied to `y\u207d\u207f\u207e`. Verifying its\ndefining recurrence is the whole content: moving `x` across one normal-ordered monomial lengthens\nthe `z`-power with coefficient `b + 1`, the `w`-power with coefficient `2 (c + 1)`, the `v`-power\nwith coefficient `3 (d + 1)`, or the `s`-power with coefficient `3 (e + 1)`, and the four\ncontributions to a summand of `d (k + 1)` add up to `b + 2c + 3d + 3e = k + 1`.\n\n## Main results\n\n* `TauCeti.Associative.mul_dividedPower_of_commutator_eq_two_nsmul`: moving one element across a\n divided power when the commutator itself has a central second commutator.\n* `TauCeti.Associative.commutator_eq_three_nsmul_of_commute`: the bracket `w * z = z * w + 3 \u2022 s`\n is forced by the other type-`G\u2082` brackets, so a consumer holding a Chevalley basis need not\n supply it separately.\n* `TauCeti.Associative.dividedPower_mul_dividedPower_of_commutator_eq_three_nsmul`: the\n coefficient-one straightening rule for the type-`G\u2082` root string.\n\n## References\n\n* R. W. Carter, *Simple Groups of Lie Type*, \u00a74.2 and Theorem 5.2.2.\n* J. E. Humphreys, *Introduction to Lie Algebras and Representation Theory*, \u00a7\u00a725--26.\n* J. C. Jantzen, *Representations of Algebraic Groups*, II.1.\n-/\n\npublic section\n\nnamespace TauCeti.Associative\n\nopen Finset\n\nvariable {A : Type*} [Semiring A] [Algebra \u211a A] {x y z w v s : A}\n\n/-! ## Moving one element across a power whose commutator is not central -/\n\n-- The ordinary-power form, stated with an exponent of the shape `b + 2` so that no truncated\n-- subtraction appears. Both released terms are present from that exponent on.\nomit [Algebra \u211a A] in\nprivate theorem mul_pow_of_commutator_eq_two_nsmul {a d : A} (hxz : x * z = z * x + a)\n (haz : a * z = z * a + 2 \u2022 d) (hzd : Commute z d) (b : \u2115) :\n x * z ^ (b + 2) =\n z ^ (b + 2) * x + (b + 2) \u2022 (z ^ (b + 1) * a) + ((b + 2) * (b + 1)) \u2022 (z ^ b * d) := by\n induction b with\n | zero =>\n change x * z ^ 2 = z ^ 2 * x + 2 \u2022 (z ^ 1 * a) + 2 \u2022 (z ^ 0 * d)\n rw [pow_two, pow_one, pow_zero, one_mul]\n calc x * (z * z) = (x * z) * z := (mul_assoc _ _ _).symm\n _ = (z * x + a) * z := by rw [hxz]\n _ = z * (x * z) + a * z := by rw [add_mul, mul_assoc]\n _ = z * (z * x + a) + (z * a + 2 \u2022 d) := by rw [hxz, haz]\n _ = _ := by rw [mul_add, \u2190 mul_assoc]; abel\n | succ b ih =>\n have hp3 : z ^ (b + 3) = z ^ (b + 2) * z := by\n rw [show b + 3 = b + 2 + 1 from by omega, pow_succ]\n have hp2 : z ^ (b + 2) = z ^ (b + 1) * z := by\n rw [show b + 2 = b + 1 + 1 from by omega, pow_succ]\n have hp1 : z ^ (b + 1) = z ^ b * z := by rw [pow_succ]\n have hfin : \u2200 T P Q : A,\n T + P + ((b + 2) \u2022 P + (2 * (b + 2)) \u2022 Q) + ((b + 2) * (b + 1)) \u2022 Q =\n T + (b + 3) \u2022 P + ((b + 3) * (b + 2)) \u2022 Q := by\n intro T P Q\n have h1 : (b + 3) \u2022 P = P + (b + 2) \u2022 P := by\n rw [show b + 3 = 1 + (b + 2) from by omega, add_smul, one_smul]\n have h2 : ((b + 3) * (b + 2)) \u2022 Q = (2 * (b + 2)) \u2022 Q + ((b + 2) * (b + 1)) \u2022 Q := by\n rw [\u2190 add_smul, show 2 * (b + 2) + (b + 2) * (b + 1) = (b + 3) * (b + 2) from by ring]\n rw [h1, h2]\n abel\n rw [show b + 1 + 2 = b + 3 from by omega, show b + 1 + 1 = b + 2 from by omega]\n calc x * z ^ (b + 3)\n = (x * z ^ (b + 2)) * z := by rw [hp3, \u2190 mul_assoc]\n _ = z ^ (b + 2) * (x * z) + (b + 2) \u2022 (z ^ (b + 1) * (a * z)) +\n ((b + 2) * (b + 1)) \u2022 (z ^ b * (d * z)) := by\n rw [ih, add_mul, add_mul, smul_mul_assoc, smul_mul_assoc, mul_assoc, mul_assoc,\n mul_assoc]\n _ = z ^ (b + 2) * (z * x + a) + (b + 2) \u2022 (z ^ (b + 1) * (z * a + 2 \u2022 d)) +\n ((b + 2) * (b + 1)) \u2022 (z ^ b * (z * d)) := by rw [hxz, haz, hzd.eq]\n _ = (z ^ (b + 3) * x + z ^ (b + 2) * a) +\n ((b + 2) \u2022 (z ^ (b + 2) * a) + (2 * (b + 2)) \u2022 (z ^ (b + 1) * d)) +\n ((b + 2) * (b + 1)) \u2022 (z ^ (b + 1) * d) := by\n rw [mul_add, \u2190 mul_assoc, \u2190 hp3, mul_add, \u2190 mul_assoc, \u2190 hp2, mul_smul_comm, smul_add,\n smul_smul, mul_comm (b + 2) 2, \u2190 mul_assoc, \u2190 hp1]\n _ = _ := hfin _ _ _\n\n/-- **Moving one element across a divided power with a non-central commutator.** Suppose\n`x * z = z * x + a` and `a * z = z * a + 2 \u2022 d`, with `d` commuting with `z`. Then\n\n```text\nx z\u207d\u1d47\u207e = z\u207d\u1d47\u207e x + z\u207d\u1d47\u207b\u00b9\u207e a + z\u207d\u1d47\u207b\u00b2\u207e d,\n```\n\nboth released terms being present exactly when their exponent is defined. Every coefficient is `1`:\nthe factor `2` in the second hypothesis is exactly what the divided powers absorb, which is why\n`d` rather than `a * z - z * a` is the integral datum. Taking `d = 0` recovers\n`mul_dividedPower_of_commutator_eq'`. -/\ntheorem mul_dividedPower_of_commutator_eq_two_nsmul {a d : A} (hxz : x * z = z * x + a)\n (haz : a * z = z * a + 2 \u2022 d) (hzd : Commute z d) (b : \u2115) :\n x * dividedPower b z =\n dividedPower b z * x + (if 0 < b then dividedPower (b - 1) z * a else 0) +\n (if 1 < b then dividedPower (b - 2) z * d else 0) := by\n match b with\n | 0 => simp\n | 1 => simpa using hxz\n | (b + 2) =>\n have key : \u2200 c F G : \u211a, c \u2260 0 \u2192 F = c * G \u2192 F\u207b\u00b9 * c = G\u207b\u00b9 := by\n intro c F G hc hF\n subst hF\n rw [mul_inv, mul_comm c\u207b\u00b9 G\u207b\u00b9, mul_assoc, inv_mul_cancel\u2080 hc, mul_one]\n have hsucc : ((b + 2).factorial : \u211a) = ((b + 2 : \u2115) : \u211a) * ((b + 1).factorial : \u211a) := by\n exact_mod_cast congrArg (fun n : \u2115 => (n : \u211a)) (Nat.factorial_succ (b + 1))\n have hsucc2 : ((b + 2).factorial : \u211a) =\n (((b + 2) * (b + 1) : \u2115) : \u211a) * (b.factorial : \u211a) := by\n have hnat : (b + 2).factorial = (b + 2) * (b + 1) * b.factorial := by\n rw [Nat.factorial_succ (b + 1), Nat.factorial_succ b, mul_assoc]\n exact_mod_cast congrArg (fun n : \u2115 => (n : \u211a)) hnat\n have hfac1 : ((b + 2).factorial : \u211a)\u207b\u00b9 * ((b + 2 : \u2115) : \u211a) = ((b + 1).factorial : \u211a)\u207b\u00b9 :=\n key _ _ _ (Nat.cast_ne_zero.mpr (by omega)) hsucc\n have hfac2 : ((b + 2).factorial : \u211a)\u207b\u00b9 * (((b + 2) * (b + 1) : \u2115) : \u211a) =\n (b.factorial : \u211a)\u207b\u00b9 :=\n key _ _ _ (Nat.cast_ne_zero.mpr (Nat.mul_ne_zero (by omega) (by omega))) hsucc2\n rw [ite_eq_left (by omega : 0 < b + 2), ite_eq_left (by omega : 1 < b + 2),\n show b + 2 - 1 = b + 1 from by omega, show b + 2 - 2 = b from by omega]\n simp only [dividedPower_def, smul_mul_assoc]\n rw [mul_smul_comm, mul_pow_of_commutator_eq_two_nsmul hxz haz hzd b, smul_add, smul_add]\n congr 1\n \u00b7 congr 1\n rw [\u2190 Nat.cast_smul_eq_nsmul \u211a, smul_smul, hfac1]\n \u00b7 rw [\u2190 Nat.cast_smul_eq_nsmul \u211a, smul_smul, hfac2]\n\n/-! ## The bracket at the root `3\u03b1 + 2\u03b2` -/\n\n", "statement": "/-- **The fifth bracket is forced.** In the type-`G\u2082` configuration the bracket of the root vectors\nof `\u03b1 + \u03b2` and `2\u03b1 + \u03b2` is not an independent datum: it is three times the root vector of `3\u03b1 + 2\u03b2`\nthat already appears as `\u2045y, v\u2046`. The proof is the Jacobi identity applied to `\u2045x, \u2045y, w\u2046\u2046 = 0`.\n\nA consumer holding a Chevalley basis therefore supplies the four brackets along the `\u03b1`-string\ntogether with `\u2045e_\u03b2, e_{3\u03b1+\u03b2}\u2046`, and reads off the hypothesis\n`w * z = z * w + 3 \u2022 s` of the straightening rule below. -/\ntheorem commutator_eq_three_nsmul_of_commute {B : Type*} [Ring B] {x y z w v s : B}\n (hxy : x * y = y * x + z) (hxw : x * w = w * x + 3 \u2022 v) (hyw : Commute y w)\n (hyv : y * v = v * y + s) :\n w * z = z * w + 3 \u2022 s ", "proof": " by\n have h1 : x * y * w = w * y * x + 3 \u2022 (v * y) + 3 \u2022 s + z * w := by\n calc x * y * w = (y * x + z) * w := by rw [hxy]\n _ = y * (x * w) + z * w := by rw [add_mul, mul_assoc]\n _ = y * (w * x + 3 \u2022 v) + z * w := by rw [hxw]\n _ = y * w * x + 3 \u2022 (y * v) + z * w := by rw [mul_add, mul_smul_comm, \u2190 mul_assoc]\n _ = w * y * x + 3 \u2022 (v * y + s) + z * w := by rw [hyw.eq, hyv]\n _ = _ := by rw [smul_add]; abel\n have h2 : x * y * w = w * y * x + 3 \u2022 (v * y) + w * z := by\n calc x * y * w = x * (w * y) := by rw [mul_assoc, hyw.eq]\n _ = (w * x + 3 \u2022 v) * y := by rw [\u2190 mul_assoc, hxw]\n _ = w * (y * x + z) + 3 \u2022 (v * y) := by rw [add_mul, mul_assoc, hxy, smul_mul_assoc]\n _ = w * y * x + w * z + 3 \u2022 (v * y) := by rw [mul_add, \u2190 mul_assoc]\n _ = _ := by abel\n have h3 : w * y * x + 3 \u2022 (v * y) + (3 \u2022 s + z * w) =\n w * y * x + 3 \u2022 (v * y) + w * z := by\n rw [\u2190 add_assoc]\n exact h1.symm.trans h2\n rw [\u2190 add_left_cancel h3]\n abel", "proof_lines": 19, "proof_length": 900, "rev": "75c8aed5fea63047615a25a9763fd5b68a86e891", "heartbeats": 1432, "image": "lean-compression:tauceti-75c8aed5fe-a608030cfc", "split": "dev"} {"path": "TauCeti/NumberTheory/NumberField/CMType/DeligneTorus.lean", "module": "TauCeti.NumberTheory.NumberField.CMType.DeligneTorus", "theorem": "TauCeti.CMType.liftEquiv_comp_deligneScalarHom", "prefix": "/-\nCopyright (c) 2026 The Tau Ceti contributors. All rights reserved.\nReleased under Apache 2.0 license as described in the file LICENSE.\nAuthors: The Tau Ceti contributors\n-/\nmodule\n\npublic import TauCeti.Algebra.AlgebraicGroup.DeligneTorus.Splitting\npublic import TauCeti.NumberTheory.NumberField.CMType.RealTensor\nimport Mathlib.Algebra.Module.Rat\nimport TauCeti.RingTheory.TensorProduct.LiftEquiv\n\n/-!\n# The Deligne homomorphism of a CM type on points\n\nFor a CM type `\u03a6` on `E`, its complex scalar map `\u2102 \u2192 \u211d \u2297[\u211a] E` induces the homomorphism from\nthe Deligne torus to the real extension of `Res_{E/\u211a} \ud835\udd3e\u2098`. On points over a real algebra `R`\nthe target is `(R \u2297[\u211a] E)\u02e3`. Over a complex algebra the `\u03c6`-coordinate is the first Deligne\ncoordinate for `\u03c6 \u2208 \u03a6` and the second for `\u03c6 \u2209 \u03a6`. Thus the associated cocharacter has exponent\none at precisely the embeddings in the type and zero elsewhere.\n\n## References\n\n* J. S. Milne, *Introduction to Shimura varieties*, Example 12.4(b).\n-/\n\npublic section\n\nopen scoped TensorProduct\nopen Algebra.TensorProduct\n\nnamespace TauCeti.CMType\n\nvariable {E : Type*} [CommRing E] [Algebra \u211a E] [Module.Finite \u211a E] [IsReduced E]\nvariable (\u03a6 : CMType E) (R : Type*) [CommRing R] [Algebra \u211d R] [Algebra \u211a R]\n\n/-- Extension of the complex scalar map of `\u03a6` to a real algebra `R`, on the algebras whose\nunits give the two tori. -/\nnoncomputable def deligneScalarHom : \u2102 \u2297[\u211d] R \u2192\u2090[\u211d] R \u2297[\u211a] E :=\n productMap ((rTensor E (Algebra.ofId \u211d R)).comp \u03a6.complexScalarHom) includeLeft\n\n@[simp]\ntheorem deligneScalarHom_tmul (z : \u2102) (r : R) :\n \u03a6.deligneScalarHom R (z \u2297\u209c[\u211d] r) =\n rTensor E (Algebra.ofId \u211d R) (\u03a6.complexScalarHom z) * (r \u2297\u209c[\u211a] 1) := by\n rw [deligneScalarHom, productMap_apply_tmul, AlgHom.comp_apply, includeLeft_apply]\n\n/-- The CM homomorphism `h_\u03a6` on points with values in a real algebra. -/\nnoncomputable def delignePoints :\n WithConv (DeligneTorus.S \u2192\u2090[\u211d] R) \u2192* (R \u2297[\u211a] E)\u02e3 :=\n (Units.map (\u03a6.deligneScalarHom R).toMonoidHom).comp (DeligneTorus.pointsMulEquiv R).toMonoidHom\n\n@[simp]\ntheorem coe_delignePoints (f : WithConv (DeligneTorus.S \u2192\u2090[\u211d] R)) :\n (\u03a6.delignePoints R f : R \u2297[\u211a] E) =\n \u03a6.deligneScalarHom R (DeligneTorus.pointsMulEquiv R f) :=\n (rfl)\n\n/-- Under the identification of real Deligne points with `\u2102\u02e3`, the CM map is induced by the\ncomplex scalar homomorphism. -/\n@[simp]\ntheorem delignePoints_realPointsMulEquiv_symm (z : \u2102\u02e3) :\n \u03a6.delignePoints \u211d (DeligneTorus.realPointsMulEquiv.symm z) =\n Units.map \u03a6.complexScalarHom.toMonoidHom z := by\n apply Units.ext\n simp [rTensor, \u2190 Algebra.TensorProduct.one_def]\n\nvariable {R} {R' : Type*} [CommRing R'] [Algebra \u211d R'] [Algebra \u211a R']\n\n/-- The scalar homomorphism inducing the CM map commutes with maps of real algebras. -/\ntheorem deligneScalarHom_comp_lTensor (g : R \u2192\u2090[\u211d] R') :\n (\u03a6.deligneScalarHom R').comp (lTensor \u2102 g) =\n (rTensor E g).comp (\u03a6.deligneScalarHom R) := by\n have hcomp : (rTensor E g).comp (rTensor E (Algebra.ofId \u211d R)) =\n rTensor (R := \u211a) E (Algebra.ofId \u211d R') := by\n simp [\u2190 map_comp (R := \u211a)]\n simp only [deligneScalarHom, comp_productMap, \u2190 AlgHom.comp_assoc, hcomp, map_comp_includeLeft]\n exact Algebra.TensorProduct.ext' fun z r \u21a6 by simp\n\n/-- The CM homomorphism is natural in the real algebra of points. -/\ntheorem delignePoints_mapValue (g : R \u2192\u2090[\u211d] R') (f : WithConv (DeligneTorus.S \u2192\u2090[\u211d] R)) :\n \u03a6.delignePoints R' (AlgHom.mapValue g f) =\n Units.map (rTensor E g).toMonoidHom (\u03a6.delignePoints R f) := by\n apply Units.ext\n simp only [coe_delignePoints, DeligneTorus.pointsMulEquiv_mapValue, Units.coe_map,\n MonoidHom.coe_ofClass]\n exact DFunLike.congr_fun (\u03a6.deligneScalarHom_comp_lTensor g) _\n\nvariable [Algebra \u2102 R] [IsScalarTower \u211d \u2102 R]\n\n", "statement": "/-- Evaluating the CM scalar homomorphism at an embedding selects the corresponding projection\nof the complex tensor splitting. -/\ntheorem liftEquiv_comp_deligneScalarHom (\u03c6 : E \u2192+* \u2102) [Decidable (\u03c6 \u2208 \u03a6)] :\n (AlgHom.restrictScalars \u211d\n (AlgHom.liftEquiv \u211a R E R ((IsScalarTower.toAlgHom \u211a \u2102 R).comp \u03c6.toRatAlgHom))).comp\n (\u03a6.deligneScalarHom R) =\n (if \u03c6 \u2208 \u03a6 then AlgHom.fst \u211d R R else AlgHom.snd \u211d R R).comp\n (complexTensorProductEquivProd R).toAlgHom ", "proof": " by\n -- Use the given real and rational algebras to infer the scalar towers.\n let : Module \u211d R := Algebra.toModule\n let : Module \u211a R := Algebra.toModule\n have hbase (x : \u211d \u2297[\u211a] E) :\n AlgHom.liftEquiv \u211a R E R ((IsScalarTower.toAlgHom \u211a \u2102 R).comp \u03c6.toRatAlgHom)\n (rTensor E (Algebra.ofId \u211d R) x) =\n algebraMap \u2102 R (AlgHom.liftEquiv \u211a \u211d E \u2102 \u03c6.toRatAlgHom x) :=\n \u03c6.toRatAlgHom.liftEquiv_rTensor_apply ((Algebra.ofId \u211d R).restrictScalars \u211a)\n (IsScalarTower.toAlgHom \u211a \u2102 R) (fun r \u21a6 (IsScalarTower.algebraMap_apply \u211d \u2102 R r).symm) x\n split_ifs with h\u03c6 <;> apply Algebra.TensorProduct.ext' <;> intro z r <;>\n simp [Algebra.smul_def, hbase, h\u03c6]", "proof_lines": 11, "proof_length": 551, "rev": "75c8aed5fea63047615a25a9763fd5b68a86e891", "heartbeats": 5363, "image": "lean-compression:tauceti-75c8aed5fe-a608030cfc", "split": "dev"} {"path": "TauCeti/Analysis/CStarAlgebra/State/Series.lean", "module": "TauCeti.Analysis.CStarAlgebra.State.Series", "theorem": "TauCeti.CStarAlgebra.exists_faithful_positiveContinuousLinearMap", "prefix": "/-\nCopyright (c) 2026 The Tau Ceti contributors. All rights reserved.\nReleased under Apache 2.0 license as described in the file LICENSE.\nAuthors: The Tau Ceti contributors\n-/\nmodule\n\npublic import Mathlib.Analysis.CStarAlgebra.PositiveLinearFunctional\npublic import TauCeti.Analysis.Normed.Operator.PositiveContinuousLinearMap\nimport Mathlib.Analysis.Normed.Group.InfiniteSum\nimport Mathlib.Analysis.SpecificLimits.Basic\nimport TauCeti.Analysis.CStarAlgebra.State.Spectrum\n\n/-!\n# Norm-convergent series of positive functionals and faithful states on C\u22c6-algebras\n\nOn a possibly nonunital complex C\u22c6-algebra, positivity turns unconditional operator-norm\nconvergence of a family `f : \u03b9 \u2192 (A \u2192P[\u2102] \u2102)` into absolute convergence: `f` is summable in\noperator norm if and only if its norms `\u2016f i\u2016` are summable\n(`PositiveContinuousLinearMap.summable_toContinuousLinearMap_iff`), and the operator norm is\nunconditionally additive over arbitrary index sets (`PositiveContinuousLinearMap.opNorm_tsum`).\nThe lower bound comes from evaluating finite partial sums along the increasing approximate unit\n`CStarAlgebra.increasingApproximateUnit A`.\n\nCombining `PositiveContinuousLinearMap.tsum` with norm-attaining states along a countable dense\nsequence in the positive cone yields a faithful norm-one positive functional on every separable\nnontrivial complex C\u22c6-algebra (`TauCeti.CStarAlgebra.exists_faithful_positiveContinuousLinearMap`).\n\n## Main declarations\n\n* `PositiveContinuousLinearMap.summable_toContinuousLinearMap_iff`: summability of positive\n functionals in the dual norm is equivalent to summability of their norms.\n* `PositiveContinuousLinearMap.hasSum_opNorm_tsum`, `PositiveContinuousLinearMap.opNorm_tsum`:\n `\u2016\u2211' i, (f i : A \u2192L[\u2102] \u2102)\u2016 = \u2211' i, \u2016(f i : A \u2192L[\u2102] \u2102)\u2016`, unconditionally.\n* `TauCeti.CStarAlgebra.exists_faithful_positiveContinuousLinearMap`: every separable nontrivial\n C\u22c6-algebra admits a norm-one positive functional strictly positive on nonzero positive elements.\n\n## References\n\n* J. Peterson, *Notes on Operator Algebras*, Propositions 4.1.4\u20134.1.5 and Corollary 4.1.7.\n* G. J. Murphy, *C\u22c6-Algebras and Operator Theory*, Section 3.4.\n-/\n\npublic section\n\nnoncomputable section\n\nopen Filter Topology\nopen scoped CStarAlgebra ComplexOrder\n\nnamespace PositiveContinuousLinearMap\n\nvariable {\u03b9 A : Type*} [NonUnitalCStarAlgebra A] [PartialOrder A] [StarOrderedRing A]\n\nprivate theorem sum_opNorm_le_opNorm_tsum {f : \u03b9 \u2192 A \u2192P[\u2102] \u2102}\n (hf : Summable fun i => (f i : A \u2192L[\u2102] \u2102)) (s : Finset \u03b9) :\n \u2211 i \u2208 s, \u2016(f i : A \u2192L[\u2102] \u2102)\u2016 \u2264 \u2016(tsum f : A \u2192L[\u2102] \u2102)\u2016 := by\n have hl := CStarAlgebra.increasingApproximateUnit A\n have := hl.neBot\n have hlim_lhs : Tendsto (fun e => \u2211 i \u2208 s, (f i e).re) (CStarAlgebra.approximateUnit A)\n (\ud835\udcdd (\u2211 i \u2208 s, \u2016(f i : A \u2192L[\u2102] \u2102)\u2016)) := by\n refine tendsto_finsetSum s fun i _ => ?_\n simpa only [Function.comp_def, Complex.ofReal_re] using\n (Complex.continuous_re.tendsto _).comp ((f i).tendsto_nhds_opNorm hl)\n have hlim_rhs : Tendsto (fun e => (tsum f e).re) (CStarAlgebra.approximateUnit A)\n (\ud835\udcdd \u2016(tsum f : A \u2192L[\u2102] \u2102)\u2016) := by\n simpa only [Function.comp_def, Complex.ofReal_re] using\n (Complex.continuous_re.tendsto _).comp ((tsum f).tendsto_nhds_opNorm hl)\n refine le_of_tendsto_of_tendsto hlim_lhs hlim_rhs ?_\n filter_upwards [hl.eventually_nonneg] with e he\n have hre : HasSum (fun i => (f i e).re) (tsum f e).re :=\n Complex.reCLM.hasSum (hasSum_tsum_apply hf e)\n simpa only [\u2190 hre.tsum_eq] using\n hre.summable.sum_le_tsum s fun i _ => (Complex.le_def.1 ((f i).map_nonneg he)).1\n\n/-- A family of positive continuous linear functionals on a C\u22c6-algebra is summable in operator\nnorm if and only if its operator norms are summable. -/\ntheorem summable_toContinuousLinearMap_iff (f : \u03b9 \u2192 A \u2192P[\u2102] \u2102) :\n Summable (fun i => (f i : A \u2192L[\u2102] \u2102)) \u2194 Summable (fun i => \u2016(f i : A \u2192L[\u2102] \u2102)\u2016) :=\n \u27e8fun hf => summable_of_sum_le (fun _ => norm_nonneg _) (sum_opNorm_le_opNorm_tsum hf),\n Summable.of_norm\u27e9\n\n/-- For a summable family of positive continuous linear functionals on a C\u22c6-algebra, the operator\nnorms sum to the operator norm of the sum. -/\ntheorem hasSum_opNorm_tsum {f : \u03b9 \u2192 A \u2192P[\u2102] \u2102} (hf : Summable fun i => (f i : A \u2192L[\u2102] \u2102)) :\n HasSum (fun i => \u2016(f i : A \u2192L[\u2102] \u2102)\u2016) \u2016(tsum f : A \u2192L[\u2102] \u2102)\u2016 := by\n have hnorm : Summable fun i => \u2016(f i : A \u2192L[\u2102] \u2102)\u2016 :=\n (summable_toContinuousLinearMap_iff f).1 hf\n have hge : \u2211' i, \u2016(f i : A \u2192L[\u2102] \u2102)\u2016 \u2264 \u2016(tsum f : A \u2192L[\u2102] \u2102)\u2016 :=\n hnorm.tsum_le_of_sum_le (sum_opNorm_le_opNorm_tsum hf)\n have hle : \u2016(tsum f : A \u2192L[\u2102] \u2102)\u2016 \u2264 \u2211' i, \u2016(f i : A \u2192L[\u2102] \u2102)\u2016 := by\n rw [toContinuousLinearMap_tsum]\n exact norm_tsum_le_tsum_norm hnorm\n simpa only [le_antisymm hle hge] using hnorm.hasSum\n\n/-- **Additivity of the norm on series of positive functionals.** The operator norm of the sum of a\nfamily of positive functionals is unconditionally the sum of the operator norms of the summands. -/\n@[simp]\ntheorem opNorm_tsum (f : \u03b9 \u2192 A \u2192P[\u2102] \u2102) :\n \u2016\u2211' i, (f i : A \u2192L[\u2102] \u2102)\u2016 = \u2211' i, \u2016(f i : A \u2192L[\u2102] \u2102)\u2016 := by\n by_cases hf : Summable fun i => (f i : A \u2192L[\u2102] \u2102)\n \u00b7 simpa only [toContinuousLinearMap_tsum] using (hasSum_opNorm_tsum hf).tsum_eq.symm\n \u00b7 have hnot : \u00ac Summable fun i => \u2016(f i : A \u2192L[\u2102] \u2102)\u2016 :=\n mt (summable_toContinuousLinearMap_iff f).2 hf\n rw [_root_.tsum_eq_zero_of_not_summable hf, norm_zero,\n _root_.tsum_eq_zero_of_not_summable hnot]\n\nend PositiveContinuousLinearMap\n\nnamespace TauCeti.CStarAlgebra\n\n", "statement": "/-- Every separable nontrivial complex C\u22c6-algebra admits a norm-one positive continuous linear\nfunctional that is strictly positive on every nonzero nonnegative element. -/\ntheorem exists_faithful_positiveContinuousLinearMap {A : Type*} [NonUnitalCStarAlgebra A]\n [PartialOrder A] [StarOrderedRing A] [TopologicalSpace.SeparableSpace A] [Nontrivial A] :\n \u2203 \u03c8 : A \u2192P[\u2102] \u2102, \u2016(\u03c8 : A \u2192L[\u2102] \u2102)\u2016 = 1 \u2227 \u2200 a : A, 0 \u2264 a \u2192 a \u2260 0 \u2192 0 < \u03c8 a ", "proof": " by\n have : Nonempty {x : A | 0 \u2264 x} := \u27e8\u27e80, le_rfl\u27e9\u27e9\n obtain \u27e8b, hb\u27e9 := TopologicalSpace.exists_dense_seq {x : A | 0 \u2264 x}\n choose \u03c6 h\u03c6_norm h\u03c6_val _ using fun n : \u2115 =>\n exists_positiveContinuousLinearMap_apply_mul_self_eq_norm_sq (b n).prop\n let w : \u2115 \u2192 \u211d := fun n => (1 : \u211d) / 2 / 2 ^ n\n have hw_nonneg (n : \u2115) : 0 \u2264 w n := by positivity\n let f : \u2115 \u2192 A \u2192P[\u2102] \u2102 := fun n =>\n PositiveContinuousLinearMap.mk\u2080 ((w n : \u2102) \u2022 (\u03c6 n : A \u2192L[\u2102] \u2102)) fun x hx =>\n mul_nonneg (Complex.le_def.2 \u27e8hw_nonneg n, rfl\u27e9) ((\u03c6 n).map_nonneg hx)\n have hf_norm (n : \u2115) : \u2016(f n : A \u2192L[\u2102] \u2102)\u2016 = w n := by\n simp [f, norm_smul, Real.norm_of_nonneg (hw_nonneg n), h\u03c6_norm n]\n have hf_sum : Summable fun n => (f n : A \u2192L[\u2102] \u2102) :=\n (PositiveContinuousLinearMap.summable_toContinuousLinearMap_iff f).2 <| by\n simpa only [hf_norm] using summable_geometric_two' (1 : \u211d)\n refine \u27e8PositiveContinuousLinearMap.tsum f, ?_, ?_\u27e9\n \u00b7 simpa [w, hf_norm] using tsum_geometric_two' (1 : \u211d)\n \u00b7 intro a ha ha0\n refine lt_of_le_of_ne ((PositiveContinuousLinearMap.tsum f).map_nonneg ha) (Ne.symm ?_)\n intro h0\n have hpos : 0 < \u2016a\u2016 / 2 := half_pos (norm_pos_iff.2 ha0)\n obtain \u27e8n, hn\u27e9 := Metric.denseRange_iff.1 hb \u27e8a, ha\u27e9 (\u2016a\u2016 / 2) hpos\n have hdist : \u2016(b n : A) - a\u2016 < \u2016a\u2016 / 2 := by\n simpa only [Subtype.dist_eq, dist_eq_norm, norm_sub_rev] using hn\n have hfn0 : f n a = 0 :=\n (PositiveContinuousLinearMap.tsum_apply_eq_zero_iff hf_sum ha).1 h0 n\n have h\u03c6n0 : \u03c6 n a = 0 := by\n have hwn : (w n : \u2102) \u2260 0 := Complex.ofReal_ne_zero.2 (by positivity)\n simpa [f, hwn] using hfn0\n have hnorm_le : \u2016(b n : A)\u2016 \u2264 \u2016(b n : A) - a\u2016 := by\n have h1 := (\u03c6 n : A \u2192L[\u2102] \u2102).le_opNorm ((b n : A) - a)\n rw [h\u03c6_norm n, one_mul, PositiveContinuousLinearMap.coe_toContinuousLinearMap, map_sub,\n h\u03c6_val n, h\u03c6n0, sub_zero, Complex.norm_real, Real.norm_of_nonneg (norm_nonneg _)] at h1\n exact h1\n have htri : \u2016a\u2016 \u2264 \u2016(b n : A)\u2016 + \u2016(b n : A) - a\u2016 := by\n simpa only [norm_sub_rev] using norm_le_norm_add_norm_sub' a (b n : A)\n linarith", "proof_lines": 36, "proof_length": 1922, "rev": "75c8aed5fea63047615a25a9763fd5b68a86e891", "heartbeats": 16441, "image": "lean-compression:tauceti-75c8aed5fe-a608030cfc", "split": "dev"} {"path": "TauCeti/RepresentationTheory/Homological/ContCohomology/CharacterExtension.lean", "module": "TauCeti.RepresentationTheory.Homological.ContCohomology.CharacterExtension", "theorem": "TauCeti.CharacterExtension.explicitDelta1_shortExact", "prefix": "/-\nCopyright (c) 2026 The Tau Ceti contributors. All rights reserved.\nReleased under Apache 2.0 license as described in the file LICENSE.\nAuthors: The Tau Ceti contributors\n-/\nmodule\n\npublic import Mathlib.Topology.Instances.ZMod\npublic import TauCeti.RepresentationTheory.Homological.ContCohomology.Coinduced.Discrete\npublic import TauCeti.RepresentationTheory.Homological.ContCohomology.Cup.Product.Basic\npublic import TauCeti.RepresentationTheory.Homological.ContCohomology.ShortExact\n\n/-!\n# The extension of `\ud835\udd3d_p` by `\ud835\udd3d_p` attached to a character\n\nLet `G` be a topological group and `\u03c7 : G \u2192 \ud835\udd3d_p` a continuous character. The **extension module**\n`E(\u03c7)` is `\ud835\udd3d_p\u00b2` with `g` acting by the unipotent matrix `[[1, \u03c7 g], [0, 1]]`,\n\n```text\ng \u2022 (a, b) = (a + \u03c7(g) b, b).\n```\n\nIt sits in the short exact sequence of discrete `G`-modules\n\n```text\n0 \u2192 \ud835\udd3d_p \u2192 E(\u03c7) \u2192 \ud835\udd3d_p \u2192 0,\n```\n\nwhich is the extension of the trivial module `\ud835\udd3d_p` by itself classified by `\u03c7`: its connecting map\n`\u03b4 : H\u00b9(G, \ud835\udd3d_p) \u2192 H\u00b2(G, \ud835\udd3d_p)` is the cup product with `\u03c7`\n(`TauCeti.CharacterExtension.explicitDelta1_shortExact`). This is the module through which a\ncharacter that cups trivially with all of `H\u00b9(G, \ud835\udd3d_p)` becomes visible in degree two: the\nconnecting map then vanishes, and `H\u00b2(G, E(\u03c7))` is as large as the two outer terms allow.\n\nIf `\u03c7` is onto, with kernel `N`, then `E(\u03c7)` is a quotient of the permutation module\n`Coind_N^G \ud835\udd3d_p = \ud835\udd3d_p[G/N]`: the trace of the coinduced map of the inclusion `\ud835\udd3d_p \u2192 E(\u03c7)` of the\nsecond coordinate is a `G`-equivariant surjection\n(`TauCeti.CharacterExtension.coindTrace_surjective`). Through Shapiro's lemma, this compares the\n`H\u00b2` of `E(\u03c7)` with the `H\u00b2` of the subgroup `N`.\n\nThe trivial modules of the short exact sequence are placed in the universe of `G` by `ULift`, as\nthe comparison of the explicit and canonical long exact sequences requires.\n\n## Main definitions\n\n* `TauCeti.CharacterExtension`: the extension module `E(\u03c7)`, a discrete `G`-module with continuous\n action, finite when `p \u2260 0`.\n* `TauCeti.CharacterExtension.shortExact`: the short exact sequence `0 \u2192 \ud835\udd3d_p \u2192 E(\u03c7) \u2192 \ud835\udd3d_p \u2192 0`.\n* `TauCeti.CharacterExtension.coindTrace`: the equivariant map `Coind_N^G \ud835\udd3d_p \u2192 E(\u03c7)` for a\n subgroup `N` on which `\u03c7` vanishes.\n\n## Main results\n\n* `TauCeti.CharacterExtension.explicitDelta1_shortExact`: the connecting map of the short exact\n sequence is the cup product with `\u03c7`.\n* `TauCeti.CharacterExtension.coindTrace_surjective`: for `\u03c7` onto and `N = ker \u03c7`, the map\n `Coind_N^G \ud835\udd3d_p \u2192 E(\u03c7)` is onto.\n-/\n\npublic section\n\nnamespace TauCeti\n\nopen ContCohomology\n\nuniverse u\n\nvariable {p : \u2115} {G : Type u} [Group G] [TopologicalSpace G]\n\n/-- **The extension module `E(\u03c7)` of a character** `\u03c7 : G \u2192 \ud835\udd3d_p`, written multiplicatively as a\ncontinuous homomorphism to `Multiplicative (ZMod p)`: the additive group `\ud835\udd3d_p\u00b2`, on which `g` acts\nby `g \u2022 (a, b) = (a + \u03c7(g) b, b)`. The character is a parameter of the type so that the action can\nbe an instance, and the module is placed in the universe of `G`. -/\n@[ext]\nstructure CharacterExtension (\u03c7 : G \u2192\u209c* Multiplicative (ZMod p)) : Type u where\n /-- The coordinate on the invariant line `\ud835\udd3d_p \u2286 E(\u03c7)`. -/\n fst : ZMod p\n /-- The coordinate on the quotient `E(\u03c7) \u2192 \ud835\udd3d_p`. -/\n snd : ZMod p\n\nnamespace CharacterExtension\n\nvariable (\u03c7 : G \u2192\u209c* Multiplicative (ZMod p))\n\ninstance : AddCommGroup (CharacterExtension \u03c7) :=\n Equiv.addCommGroup \u27e8fun x \u21a6 (x.fst, x.snd), fun x \u21a6 \u27e8x.1, x.2\u27e9, fun _ \u21a6 rfl, fun _ \u21a6 rfl\u27e9\n\n@[simp] theorem fst_zero : (0 : CharacterExtension \u03c7).fst = 0 := (rfl)\n\n@[simp] theorem snd_zero : (0 : CharacterExtension \u03c7).snd = 0 := (rfl)\n\n@[simp] theorem fst_add (x y : CharacterExtension \u03c7) : (x + y).fst = x.fst + y.fst := (rfl)\n\n@[simp] theorem snd_add (x y : CharacterExtension \u03c7) : (x + y).snd = x.snd + y.snd := (rfl)\n\n@[simp] theorem fst_neg (x : CharacterExtension \u03c7) : (-x).fst = -x.fst := (rfl)\n\n@[simp] theorem snd_neg (x : CharacterExtension \u03c7) : (-x).snd = -x.snd := (rfl)\n\n@[simp] theorem fst_sub (x y : CharacterExtension \u03c7) : (x - y).fst = x.fst - y.fst := (rfl)\n\n@[simp] theorem snd_sub (x y : CharacterExtension \u03c7) : (x - y).snd = x.snd - y.snd := (rfl)\n\ninstance : TopologicalSpace (CharacterExtension \u03c7) := \u22a5\n\ninstance : DiscreteTopology (CharacterExtension \u03c7) := \u27e8rfl\u27e9\n\ninstance [NeZero p] : Finite (CharacterExtension \u03c7) :=\n Finite.of_injective (fun x : CharacterExtension \u03c7 \u21a6 (x.fst, x.snd)) fun _ _ h \u21a6\n CharacterExtension.ext (congrArg Prod.fst h) (congrArg Prod.snd h)\n\n/-- `g` acts on `E(\u03c7)` by the unipotent matrix `[[1, \u03c7 g], [0, 1]]`. -/\ninstance : SMul G (CharacterExtension \u03c7) where\n smul g x := \u27e8x.fst + Multiplicative.toAdd (\u03c7 g) * x.snd, x.snd\u27e9\n\n@[simp]\ntheorem fst_smul (g : G) (x : CharacterExtension \u03c7) :\n (g \u2022 x).fst = x.fst + Multiplicative.toAdd (\u03c7 g) * x.snd :=\n (rfl)\n\n@[simp]\ntheorem snd_smul (g : G) (x : CharacterExtension \u03c7) : (g \u2022 x).snd = x.snd := (rfl)\n\n/-- The action of `G` on `E(\u03c7)` is distributive, because `\u03c7` is a homomorphism. -/\ninstance : DistribMulAction G (CharacterExtension \u03c7) where\n one_smul x := CharacterExtension.ext (by simp) rfl\n mul_smul g h x := CharacterExtension.ext (by simp [toAdd_mul]; ring) rfl\n smul_zero g := CharacterExtension.ext (by simp) rfl\n smul_add g x y := CharacterExtension.ext (by simp; ring) rfl\n\n/-- The action of `G` on the discrete module `E(\u03c7)` is continuous, because `\u03c7` is. -/\ninstance : ContinuousSMul G (CharacterExtension \u03c7) where\n continuous_smul :=\n (continuous_of_discreteTopology (f := fun q : ZMod p \u00d7 CharacterExtension \u03c7 \u21a6\n (\u27e8q.2.fst + q.1 * q.2.snd, q.2.snd\u27e9 : CharacterExtension \u03c7))).comp\n (((continuous_toAdd.comp \u03c7.continuous).comp continuous_fst).prodMk continuous_snd)\n\n/-- An element of the kernel of `\u03c7` acts trivially on `E(\u03c7)`. -/\ntheorem smul_eq_self_of_apply_eq_one {g : G} (hg : \u03c7 g = 1) (x : CharacterExtension \u03c7) :\n g \u2022 x = x :=\n CharacterExtension.ext (by simp [hg]) rfl\n\n/-! ### The short exact sequence `0 \u2192 \ud835\udd3d_p \u2192 E(\u03c7) \u2192 \ud835\udd3d_p \u2192 0` -/\n\nsection ShortExact\n\nvariable [DistribMulAction G (ZMod p)] (htriv : \u2200 (g : G) (m : ZMod p), g \u2022 m = m)\ninclude htriv\n\n/-- **The short exact sequence `0 \u2192 \ud835\udd3d_p \u2192 E(\u03c7) \u2192 \ud835\udd3d_p \u2192 0`** of discrete `G`-modules, for a\ntrivial action on `\ud835\udd3d_p`: the inclusion of the first coordinate and the projection to the second.\nThe trivial modules are lifted to the universe of `G`. -/\ndef shortExact :\n DiscreteShortExact G (ULift.{u} (ZMod p)) (CharacterExtension \u03c7) (ULift.{u} (ZMod p)) where\n incl :=\n { toFun a := \u27e8a.down, 0\u27e9\n map_zero' := rfl\n map_add' a b := CharacterExtension.ext rfl (add_zero 0).symm }\n proj :=\n { toFun x := ULift.up x.snd\n map_zero' := rfl\n map_add' _ _ := rfl }\n incl_equivariant g a := CharacterExtension.ext (by simp [htriv]) rfl\n proj_equivariant g x := ULift.ext (by simp [htriv])\n incl_injective a b h := ULift.ext (congrArg fst h)\n proj_surjective a := \u27e8\u27e80, a.down\u27e9, rfl\u27e9\n exact x := \u27e8fun h \u21a6 \u27e8ULift.up x.fst, CharacterExtension.ext rfl (congrArg ULift.down h).symm\u27e9,\n by rintro \u27e8a, rfl\u27e9; rfl\u27e9\n\n@[simp]\ntheorem shortExact_incl_apply (a : ULift.{u} (ZMod p)) :\n (shortExact \u03c7 htriv).incl a = \u27e8a.down, 0\u27e9 :=\n (rfl)\n\n@[simp]\ntheorem shortExact_proj_apply (x : CharacterExtension \u03c7) :\n (shortExact \u03c7 htriv).proj x = ULift.up x.snd :=\n (rfl)\n\nvariable [IsTopologicalGroup G] [ContinuousSMul G (ZMod p)]\n [ContinuousSMul G (ULift.{u} (ZMod p))]\n\n", "statement": "/-- **The connecting map of `0 \u2192 \ud835\udd3d_p \u2192 E(\u03c7) \u2192 \ud835\udd3d_p \u2192 0` is the cup product with `\u03c7`**: for a class\n`x \u2208 H\u00b9(G, \ud835\udd3d_p)`, `\u03b4 x = \u03c7 \u2323 x` in `H\u00b2(G, \ud835\udd3d_p)`, the cup product being taken for the scalar\nmultiplication `\ud835\udd3d_p \u00d7 \ud835\udd3d_p \u2192 \ud835\udd3d_p` and `\u03c7` being read as a class through the identification of\n`H\u00b9(G, \ud835\udd3d_p)` with the continuous characters. -/\ntheorem explicitDelta1_shortExact (x : H1 G (ULift.{u} (ZMod p))) :\n (shortExact \u03c7 htriv).explicitDelta1 x =\n explicitCup11 G (ZMod p) (ULift.{u} (ZMod p)) (ULift.{u} (ZMod p))\n (smulAddHom (ZMod p) (ULift.{u} (ZMod p))) continuous_of_discreteTopology\n (fun g a b \u21a6 by ext; simp [htriv])\n ((H1EquivOfSmulEqSelf htriv).symm (Additive.ofMul \u03c7)) x ", "proof": " by\n induction x using QuotientAddGroup.induction_on with\n | _ f =>\n obtain \u27e8hfc, hf1\u27e9 := mem_Z1_iff.1 f.property\n -- the lift `g \u21a6 (0, \u03c8 g)` of the cocycle `\u03c8`, whose coboundary is `(g, h) \u21a6 (\u03c7 g \u03c8 h, 0)`\n have hec : Continuous fun g : G \u21a6 (\u27e80, ((f : G \u2192 ULift (ZMod p)) g).down\u27e9 :\n CharacterExtension \u03c7) :=\n (continuous_of_discreteTopology (f := fun a : ULift.{u} (ZMod p) \u21a6\n (\u27e80, a.down\u27e9 : CharacterExtension \u03c7))).comp hfc\n have hmul : \u2200 g h : G, (f : G \u2192 ULift (ZMod p)) (g * h) =\n (f : G \u2192 ULift (ZMod p)) g + (f : G \u2192 ULift (ZMod p)) h := fun g h \u21a6 by\n have h1 := hf1 g h\n have hg : g \u2022 (f : G \u2192 ULift (ZMod p)) h = (f : G \u2192 ULift (ZMod p)) h :=\n ULift.ext (by simp [htriv])\n rw [hg] at h1\n rw [h1, add_comm]\n have hae : \u2200 g h : G, (shortExact \u03c7 htriv).incl\n (ULift.up (Multiplicative.toAdd (\u03c7 g) * ((f : G \u2192 ULift (ZMod p)) h).down)) =\n g \u2022 (\u27e80, ((f : G \u2192 ULift (ZMod p)) h).down\u27e9 : CharacterExtension \u03c7) -\n \u27e80, ((f : G \u2192 ULift (ZMod p)) (g * h)).down\u27e9 +\n \u27e80, ((f : G \u2192 ULift (ZMod p)) g).down\u27e9 := fun g h \u21a6 by\n refine CharacterExtension.ext (by simp) ?_\n simp only [shortExact_incl_apply, snd_add, snd_sub, snd_smul, hmul g h, ULift.add_down]\n ring\n have h\u03b4 := (shortExact \u03c7 htriv).explicitDelta1_apply f hec (fun g \u21a6 rfl)\n (a := fun q : G \u00d7 G \u21a6\n ULift.up (Multiplicative.toAdd (\u03c7 q.1) * ((f : G \u2192 ULift (ZMod p)) q.2).down))\n hae\n simp only [QuotientAddGroup.mk'_apply] at h\u03b4\n rw [h\u03b4, H1EquivOfSmulEqSelf_symm_apply, explicitCup11_mk]\n refine congrArg (H2pi G (ULift (ZMod p))) (Subtype.ext (funext fun q \u21a6 ULift.ext ?_))\n obtain \u27e8g, h\u27e9 := q\n have hg : g \u2022 (f : G \u2192 ULift (ZMod p)) h = (f : G \u2192 ULift (ZMod p)) h :=\n ULift.ext (by simp [htriv])\n simp [hg, smulAddHom_apply]", "proof_lines": 34, "proof_length": 1556, "rev": "75c8aed5fea63047615a25a9763fd5b68a86e891", "heartbeats": 6904, "image": "lean-compression:tauceti-75c8aed5fe-a608030cfc", "split": "dev"} {"path": "TauCeti/Analysis/Complex/Annulus/RealBoundaryKernel.lean", "module": "TauCeti.Analysis.Complex.Annulus.RealBoundaryKernel", "theorem": "TauCeti.Complex.annulusRealBoundaryAdjointKernel_eq_span", "prefix": "/-\nCopyright (c) 2026 The Tau Ceti contributors. All rights reserved.\nReleased under Apache 2.0 license as described in the file LICENSE.\nAuthors: The Tau Ceti contributors\n-/\nmodule\n\npublic import Mathlib.Analysis.Calculus.FDeriv.Defs\npublic import Mathlib.Analysis.Complex.Basic\npublic import Mathlib.LinearAlgebra.FiniteDimensional.Basic\nimport Mathlib.Analysis.Complex.AbsMax\nimport Mathlib.Analysis.Complex.OpenMapping\nimport TauCeti.Analysis.Complex.Annulus.Basic\nimport TauCeti.Topology.MetricSpace.Pseudo.Lemmas\n\n/-!\n# Kernel and adjoint kernel of the Cauchy\u2013Riemann operator on the annulus with real boundary values\n\nLet `0 < r\u2081 < r\u2082` and let `A = closedBall 0 r\u2082 \\ ball 0 r\u2081` be the closed annulus, with open\ninterior `ball 0 r\u2082 \\ closedBall 0 r\u2081` and boundary circles `sphere 0 r\u2081` and `sphere 0 r\u2082`.\nThis file computes the kernel and the adjoint kernel of the Cauchy\u2013Riemann operator\n`D = \u2202/\u2202(conj z)` on the trivial line bundle `\u2102` over `A`, with the totally real boundary\ncondition `\u211d` on both circles. These are the two counts in the annulus example of the\nRiemann\u2013Roch theorem for bordered Riemann surfaces (McDuff\u2013Salamon, *J-holomorphic curves and\nsymplectic topology*, Theorem C.1.10): there `\u03c7(A) = 0` and `\u03bc(\u2102, \u211d) = 0`, so the index is `0`,\nwith kernel and cokernel both of real dimension `1`.\n\n* Kernel. A function `f` that is holomorphic on the open annulus, continuous on `A` and real on\n both circles is a real constant on `A`\n (`TauCeti.Complex.exists_eq_ofReal_of_im_eq_zero_on_annulus_boundary`). The maximum modulus\n principle applied to `exp (\u00b1 i f)`, whose modulus is `exp (\u2213 im f)`, forces `im f = 0` on `A`,\n and the open mapping theorem then makes `f` constant on the connected open annulus.\n* Adjoint kernel. A `(0,1)`-form `\u03b7 = conj g d(conj z)` satisfies the adjoint boundary condition\n `\u03b7(\u2202_\u03b8) \u2208 \u211d` on both circles exactly when `i z g z` is real there, because\n `d(conj z)(\u2202_\u03b8) = conj (i z)`. Applying the kernel computation to `i z g z` shows that `g`\n is a real multiple of `(i z)\u207b\u00b9` on `A`\n (`TauCeti.Complex.exists_eq_mul_inv_of_im_I_mul_eq_zero_on_annulus_boundary`).\n\nRestricting to `A`, both spaces are real lines\n(`TauCeti.Complex.finrank_annulusRealBoundaryKernel`,\n`TauCeti.Complex.finrank_annulusRealBoundaryAdjointKernel`), and the difference of their\ndimensions is `0 = \u03c7(A) + \u03bc(\u2102, \u211d)` (`TauCeti.Complex.annulusRealBoundary_index_eq_zero`).\n\n## Main definitions\n\n* `TauCeti.Complex.realBoundaryHolomorphic r\u2081 r\u2082`: the real subspace of functions `\u2102 \u2192 \u2102`\n holomorphic on the open annulus, continuous on the closed annulus and real on both circles.\n* `TauCeti.Complex.realBoundaryAdjointHolomorphic r\u2081 r\u2082`: the same, with `i z g z` real on\n both circles in place of `g`.\n* `TauCeti.Complex.annulusRealBoundaryKernel r\u2081 r\u2082`,\n `TauCeti.Complex.annulusRealBoundaryAdjointKernel r\u2081 r\u2082`: their restrictions to the closed\n annulus.\n-/\n\npublic section\n\nopen Complex Set Metric Module\n\nnamespace TauCeti.Complex\n\n/-- If `f` is holomorphic on the open annulus, continuous on the closed annulus and real on both\nboundary circles, then its imaginary part is nonnegative on the closed annulus. This is the\nmaximum modulus principle for `exp (i f)`, whose modulus is `exp (-im f)`. -/\nprivate theorem im_nonneg_of_im_eq_zero_on_annulus_boundary {r\u2081 r\u2082 : \u211d} (hr\u2081 : 0 \u2264 r\u2081)\n (h : r\u2081 < r\u2082) {f : \u2102 \u2192 \u2102} (hf : DifferentiableOn \u2102 f (ball 0 r\u2082 \\ closedBall 0 r\u2081))\n (hfc : ContinuousOn f (closedBall 0 r\u2082 \\ ball 0 r\u2081))\n (hbd : \u2200 z \u2208 sphere (0 : \u2102) r\u2081 \u222a sphere 0 r\u2082, (f z).im = 0) {z : \u2102}\n (hz : z \u2208 closedBall 0 r\u2082 \\ ball 0 r\u2081) : 0 \u2264 (f z).im := by\n have hnorm : \u2200 w, \u2016exp (I * f w)\u2016 = Real.exp (-(f w).im) := fun w => by\n rw [norm_exp, mul_re, I_re, I_im]\n ring_nf\n have hd : DiffContOnCl \u2102 (fun w => exp (I * f w)) (ball 0 r\u2082 \\ closedBall 0 r\u2081) := by\n refine \u27e8(hf.const_mul I).cexp, ?_\u27e9\n rw [closure_ball_diff_closedBall hr\u2081 h]\n exact (hfc.const_mul I).cexp\n have hle := Complex.norm_le_of_forall_mem_frontier_norm_le\n (isBounded_ball.subset sdiff_subset) hd (C := 1)\n (fun w hw => by\n rw [sdiff_eq] at hw\n rw [hnorm, hbd w (union_comm (sphere (0 : \u2102) r\u2082) _ \u25b8\n frontier_ball_inter_compl_closedBall_subset 0 r\u2081 r\u2082 hw), neg_zero, Real.exp_zero])\n (by rwa [closure_ball_diff_closedBall hr\u2081 h])\n rw [hnorm, Real.exp_le_one_iff] at hle\n linarith\n\n/-- **Kernel of the Cauchy\u2013Riemann operator on the annulus with real boundary values.** If `f`\nis holomorphic on the open annulus `ball 0 r\u2082 \\ closedBall 0 r\u2081`, continuous on the closed\nannulus and real on both boundary circles, then `f` is a real constant on the closed annulus. -/\ntheorem exists_eq_ofReal_of_im_eq_zero_on_annulus_boundary {r\u2081 r\u2082 : \u211d} (hr\u2081 : 0 \u2264 r\u2081)\n (h : r\u2081 < r\u2082) {f : \u2102 \u2192 \u2102} (hf : DifferentiableOn \u2102 f (ball 0 r\u2082 \\ closedBall 0 r\u2081))\n (hfc : ContinuousOn f (closedBall 0 r\u2082 \\ ball 0 r\u2081))\n (hbd : \u2200 z \u2208 sphere (0 : \u2102) r\u2081 \u222a sphere 0 r\u2082, (f z).im = 0) :\n \u2203 c : \u211d, \u2200 z \u2208 closedBall (0 : \u2102) r\u2082 \\ ball 0 r\u2081, f z = c := by\n have hUA : ball (0 : \u2102) r\u2082 \\ closedBall 0 r\u2081 \u2286 closedBall 0 r\u2082 \\ ball 0 r\u2081 := by\n rw [\u2190 closure_ball_diff_closedBall hr\u2081 h]\n exact subset_closure\n -- the imaginary part vanishes on the closed annulus\n have him : \u2200 z \u2208 closedBall (0 : \u2102) r\u2082 \\ ball 0 r\u2081, (f z).im = 0 := fun z hz =>\n le_antisymm\n (by\n have := im_nonneg_of_im_eq_zero_on_annulus_boundary hr\u2081 h hf.neg hfc.neg\n (fun w hw => by rw [Pi.neg_apply, neg_im, hbd w hw, neg_zero]) hz\n rw [Pi.neg_apply, neg_im] at this\n linarith)\n (im_nonneg_of_im_eq_zero_on_annulus_boundary hr\u2081 h hf hfc hbd hz)\n -- a point of the open annulus\n have hz\u2080 : (((r\u2081 + r\u2082) / 2 : \u211d) : \u2102) \u2208 ball (0 : \u2102) r\u2082 \\ closedBall 0 r\u2081 := by\n rw [ball_diff_closedBall_eq_preimage, mem_preimage, norm_real, Real.norm_eq_abs,\n abs_of_nonneg (by linarith), mem_Ioo]\n constructor <;> linarith\n -- open mapping: `f` is constant on `U`\n have hU : IsOpen (ball (0 : \u2102) r\u2082 \\ closedBall 0 r\u2081) := isOpen_ball.sdiff isClosed_closedBall\n obtain \u27e8w, hw\u27e9 := (hf.analyticOnNhd hU).eq_const_of_im_eq_const (fun z hz => him z (hUA hz)) hU\n \u27e8\u27e8_, hz\u2080\u27e9, isPreconnected_ball_diff_closedBall hr\u2081 r\u2082\u27e9\n have hweq : EqOn f (fun _ => w) (closedBall 0 r\u2082 \\ ball 0 r\u2081) :=\n EqOn.of_subset_closure hw hfc continuousOn_const hUA\n (closure_ball_diff_closedBall hr\u2081 h).ge\n refine \u27e8w.re, fun z hz => ?_\u27e9\n rw [hweq hz]\n refine Complex.ext (by simp) ?_\n rw [ofReal_im, \u2190 hw _ hz\u2080, him _ (hUA hz\u2080)]\n\n/-- **Adjoint kernel of the Cauchy\u2013Riemann operator on the annulus with real boundary\nvalues.** If `g` is holomorphic on the open annulus, continuous on the closed annulus, and\n`i z g z` is real on both boundary circles (the adjoint boundary condition for\n`\u03b7 = conj g d(conj z)`), then `g` is a real multiple of `(i z)\u207b\u00b9` on the closed annulus. -/\ntheorem exists_eq_mul_inv_of_im_I_mul_eq_zero_on_annulus_boundary {r\u2081 r\u2082 : \u211d} (hr\u2081 : 0 < r\u2081)\n (h : r\u2081 < r\u2082) {g : \u2102 \u2192 \u2102} (hg : DifferentiableOn \u2102 g (ball 0 r\u2082 \\ closedBall 0 r\u2081))\n (hgc : ContinuousOn g (closedBall 0 r\u2082 \\ ball 0 r\u2081))\n (hbd : \u2200 z \u2208 sphere (0 : \u2102) r\u2081 \u222a sphere 0 r\u2082, (I * z * g z).im = 0) :\n \u2203 c : \u211d, \u2200 z \u2208 closedBall (0 : \u2102) r\u2082 \\ ball 0 r\u2081, g z = c * (I * z)\u207b\u00b9 := by\n obtain \u27e8c, hc\u27e9 := exists_eq_ofReal_of_im_eq_zero_on_annulus_boundary (f := fun z => I * z * g z)\n hr\u2081.le h ((differentiableOn_id.const_mul I).mul hg) ((continuousOn_id.const_mul I).mul hgc) hbd\n refine \u27e8c, fun z hz => ?_\u27e9\n have hz0 : z \u2260 0 := by\n rintro rfl\n simp only [mem_sdiff, mem_ball_zero_iff, norm_zero] at hz\n exact hz.2 hr\u2081\n rw [eq_mul_inv_iff_mul_eq\u2080 (mul_ne_zero I_ne_zero hz0), \u2190 hc z hz]\n ring\n\n/-- The real subspace of functions `\u2102 \u2192 \u2102` that are holomorphic on the open annulus\n`ball 0 r\u2082 \\ closedBall 0 r\u2081`, continuous on the closed annulus, and real on both boundary\ncircles: before restriction to the annulus, the kernel of `\u2202/\u2202(conj z)` with the totally real\nboundary condition `\u211d`. -/\nnoncomputable def realBoundaryHolomorphic (r\u2081 r\u2082 : \u211d) : Submodule \u211d (\u2102 \u2192 \u2102) where\n carrier := {f | DifferentiableOn \u2102 f (ball 0 r\u2082 \\ closedBall 0 r\u2081) \u2227\n ContinuousOn f (closedBall 0 r\u2082 \\ ball 0 r\u2081) \u2227\n \u2200 z \u2208 sphere (0 : \u2102) r\u2081 \u222a sphere 0 r\u2082, (f z).im = 0}\n zero_mem' := \u27e8differentiableOn_const 0, continuousOn_const, fun _ _ => zero_im\u27e9\n add_mem' := fun {f g} hf hg => \u27e8hf.1.add hg.1, hf.2.1.add hg.2.1, fun z hz => by\n rw [Pi.add_apply, add_im, hf.2.2 z hz, hg.2.2 z hz, add_zero]\u27e9\n smul_mem' := fun c f hf => by\n have hsmul : c \u2022 f = fun z => (c : \u2102) * f z := funext fun z => by\n rw [Pi.smul_apply, real_smul]\n rw [hsmul]\n exact \u27e8hf.1.const_mul _, hf.2.1.const_mul _, fun z hz => by\n rw [im_ofReal_mul, hf.2.2 z hz, mul_zero]\u27e9\n\n/-- Membership in `realBoundaryHolomorphic` unfolds to its three defining conditions. -/\n@[simp]\ntheorem mem_realBoundaryHolomorphic {r\u2081 r\u2082 : \u211d} {f : \u2102 \u2192 \u2102} :\n f \u2208 realBoundaryHolomorphic r\u2081 r\u2082 \u2194\n DifferentiableOn \u2102 f (ball 0 r\u2082 \\ closedBall 0 r\u2081) \u2227\n ContinuousOn f (closedBall 0 r\u2082 \\ ball 0 r\u2081) \u2227\n \u2200 z \u2208 sphere (0 : \u2102) r\u2081 \u222a sphere 0 r\u2082, (f z).im = 0 :=\n Iff.rfl\n\n/-- The real subspace of functions `g : \u2102 \u2192 \u2102` that are holomorphic on the open annulus,\ncontinuous on the closed annulus, and satisfy the adjoint boundary condition that `i z g z` is\nreal on both boundary circles: before restriction to the annulus, the kernel of the formal\nadjoint of `\u2202/\u2202(conj z)`, through `\u03b7 = conj g d(conj z)`. -/\nnoncomputable def realBoundaryAdjointHolomorphic (r\u2081 r\u2082 : \u211d) : Submodule \u211d (\u2102 \u2192 \u2102) where\n carrier := {g | DifferentiableOn \u2102 g (ball 0 r\u2082 \\ closedBall 0 r\u2081) \u2227\n ContinuousOn g (closedBall 0 r\u2082 \\ ball 0 r\u2081) \u2227\n \u2200 z \u2208 sphere (0 : \u2102) r\u2081 \u222a sphere 0 r\u2082, (I * z * g z).im = 0}\n zero_mem' := \u27e8differentiableOn_const 0, continuousOn_const, fun _ _ => by\n rw [Pi.zero_apply, mul_zero, zero_im]\u27e9\n add_mem' := fun {f g} hf hg => \u27e8hf.1.add hg.1, hf.2.1.add hg.2.1, fun z hz => by\n rw [Pi.add_apply, mul_add, add_im, hf.2.2 z hz, hg.2.2 z hz, add_zero]\u27e9\n smul_mem' := fun c f hf => by\n have hsmul : c \u2022 f = fun z => (c : \u2102) * f z := funext fun z => by\n rw [Pi.smul_apply, real_smul]\n rw [hsmul]\n exact \u27e8hf.1.const_mul _, hf.2.1.const_mul _, fun z hz => by\n rw [mul_left_comm, im_ofReal_mul, hf.2.2 z hz, mul_zero]\u27e9\n\n/-- Membership in `realBoundaryAdjointHolomorphic` unfolds to its three defining conditions. -/\n@[simp]\ntheorem mem_realBoundaryAdjointHolomorphic {r\u2081 r\u2082 : \u211d} {g : \u2102 \u2192 \u2102} :\n g \u2208 realBoundaryAdjointHolomorphic r\u2081 r\u2082 \u2194\n DifferentiableOn \u2102 g (ball 0 r\u2082 \\ closedBall 0 r\u2081) \u2227\n ContinuousOn g (closedBall 0 r\u2082 \\ ball 0 r\u2081) \u2227\n \u2200 z \u2208 sphere (0 : \u2102) r\u2081 \u222a sphere 0 r\u2082, (I * z * g z).im = 0 :=\n Iff.rfl\n\n/-- The kernel of the Cauchy\u2013Riemann operator `\u2202/\u2202(conj z)` on the closed annulus with real\nboundary values on both circles: the restrictions to `closedBall 0 r\u2082 \\ ball 0 r\u2081` of\n`realBoundaryHolomorphic r\u2081 r\u2082`. -/\nnoncomputable def annulusRealBoundaryKernel (r\u2081 r\u2082 : \u211d) :\n Submodule \u211d (\u21a5(closedBall (0 : \u2102) r\u2082 \\ ball 0 r\u2081) \u2192 \u2102) :=\n (realBoundaryHolomorphic r\u2081 r\u2082).map (LinearMap.funLeft \u211d \u2102 Subtype.val)\n\n/-- The kernel of the formal adjoint of the Cauchy\u2013Riemann operator `\u2202/\u2202(conj z)` on the closed\nannulus with real boundary values on both circles: the restrictions to\n`closedBall 0 r\u2082 \\ ball 0 r\u2081` of `realBoundaryAdjointHolomorphic r\u2081 r\u2082`. -/\nnoncomputable def annulusRealBoundaryAdjointKernel (r\u2081 r\u2082 : \u211d) :\n Submodule \u211d (\u21a5(closedBall (0 : \u2102) r\u2082 \\ ball 0 r\u2081) \u2192 \u2102) :=\n (realBoundaryAdjointHolomorphic r\u2081 r\u2082).map (LinearMap.funLeft \u211d \u2102 Subtype.val)\n\n/-- A function on the closed annulus lies in `annulusRealBoundaryKernel` exactly when it is the\nrestriction of a function in `realBoundaryHolomorphic`. -/\ntheorem mem_annulusRealBoundaryKernel_iff {r\u2081 r\u2082 : \u211d}\n {f : \u21a5(closedBall (0 : \u2102) r\u2082 \\ ball 0 r\u2081) \u2192 \u2102} :\n f \u2208 annulusRealBoundaryKernel r\u2081 r\u2082 \u2194\n \u2203 F \u2208 realBoundaryHolomorphic r\u2081 r\u2082,\n \u2200 z : \u21a5(closedBall (0 : \u2102) r\u2082 \\ ball 0 r\u2081), F z = f z :=\n Submodule.mem_map.trans <| exists_congr fun _ => and_congr_right fun _ => funext_iff\n\n/-- A function on the closed annulus lies in `annulusRealBoundaryAdjointKernel` exactly when it\nis the restriction of a function in `realBoundaryAdjointHolomorphic`. -/\ntheorem mem_annulusRealBoundaryAdjointKernel_iff {r\u2081 r\u2082 : \u211d}\n {g : \u21a5(closedBall (0 : \u2102) r\u2082 \\ ball 0 r\u2081) \u2192 \u2102} :\n g \u2208 annulusRealBoundaryAdjointKernel r\u2081 r\u2082 \u2194\n \u2203 G \u2208 realBoundaryAdjointHolomorphic r\u2081 r\u2082,\n \u2200 z : \u21a5(closedBall (0 : \u2102) r\u2082 \\ ball 0 r\u2081), G z = g z :=\n Submodule.mem_map.trans <| exists_congr fun _ => and_congr_right fun _ => funext_iff\n\n/-- The annulus kernel with real boundary values is the line of real constants. -/\ntheorem annulusRealBoundaryKernel_eq_span {r\u2081 r\u2082 : \u211d} (hr\u2081 : 0 \u2264 r\u2081) (h : r\u2081 < r\u2082) :\n annulusRealBoundaryKernel r\u2081 r\u2082 = \u211d \u2219 fun _ => 1 := by\n refine le_antisymm ?_ ?_\n \u00b7 rintro _ \u27e8f, \u27e8hf, hfc, hbd\u27e9, rfl\u27e9\n obtain \u27e8c, hc\u27e9 := exists_eq_ofReal_of_im_eq_zero_on_annulus_boundary hr\u2081 h hf hfc hbd\n refine Submodule.mem_span_singleton.2 \u27e8c, funext fun z => ?_\u27e9\n rw [Pi.smul_apply, real_smul, mul_one, LinearMap.funLeft_apply, hc z z.property]\n \u00b7 refine (Submodule.span_singleton_le_iff_mem _ _).2 \u27e8fun _ => 1, ?_, rfl\u27e9\n exact \u27e8differentiableOn_const 1, continuousOn_const, fun _ _ => one_im\u27e9\n\n", "statement": "/-- The annulus adjoint kernel with real boundary values is the real line spanned by\n`z \u21a6 (i z)\u207b\u00b9`. -/\ntheorem annulusRealBoundaryAdjointKernel_eq_span {r\u2081 r\u2082 : \u211d} (hr\u2081 : 0 < r\u2081) (h : r\u2081 < r\u2082) :\n annulusRealBoundaryAdjointKernel r\u2081 r\u2082 =\n \u211d \u2219 fun z : \u21a5(closedBall (0 : \u2102) r\u2082 \\ ball 0 r\u2081) => (I * z)\u207b\u00b9 ", "proof": " by\n have hne : \u2200 z \u2208 closedBall (0 : \u2102) r\u2082 \\ ball 0 r\u2081, z \u2260 0 := by\n rintro z hz rfl\n simp only [mem_sdiff, mem_ball_zero_iff, norm_zero] at hz\n exact hz.2 hr\u2081\n refine le_antisymm ?_ ?_\n \u00b7 rintro _ \u27e8g, \u27e8hg, hgc, hbd\u27e9, rfl\u27e9\n obtain \u27e8c, hc\u27e9 := exists_eq_mul_inv_of_im_I_mul_eq_zero_on_annulus_boundary hr\u2081 h hg hgc hbd\n refine Submodule.mem_span_singleton.2 \u27e8c, funext fun z => ?_\u27e9\n rw [Pi.smul_apply, real_smul, LinearMap.funLeft_apply, hc z z.property]\n \u00b7 refine (Submodule.span_singleton_le_iff_mem _ _).2 \u27e8fun z => (I * z)\u207b\u00b9, ?_, rfl\u27e9\n have hU : \u2200 z \u2208 ball (0 : \u2102) r\u2082 \\ closedBall 0 r\u2081, I * z \u2260 0 := fun z hz =>\n mul_ne_zero I_ne_zero (hne z (by\n rw [\u2190 closure_ball_diff_closedBall hr\u2081.le h]\n exact subset_closure hz))\n refine \u27e8(differentiableOn_id.const_mul I).inv hU,\n (continuousOn_id.const_mul I).inv\u2080 fun z hz => mul_ne_zero I_ne_zero (hne z hz),\n fun z hz => ?_\u27e9\n have hz0 : z \u2260 0 := by\n rintro rfl\n rcases hz with hz | hz <;>\n simp only [mem_sphere_zero_iff_norm, norm_zero] at hz <;> linarith\n rw [mul_inv_cancel\u2080 (mul_ne_zero I_ne_zero hz0), one_im]", "proof_lines": 22, "proof_length": 1038, "rev": "75c8aed5fea63047615a25a9763fd5b68a86e891", "heartbeats": 1210, "image": "lean-compression:tauceti-75c8aed5fe-a608030cfc", "split": "dev"} {"path": "TauCeti/Examples/RepresentationTheory/Continuous/Reduction.lean", "module": "TauCeti.Examples.RepresentationTheory.Continuous.Reduction", "theorem": "TauCeti.ContinuousRep.ReductionCheck.exists_reduction_qlOne", "prefix": "/-\nCopyright (c) 2026 The Tau Ceti contributors. All rights reserved.\nReleased under Apache 2.0 license as described in the file LICENSE.\nAuthors: The Tau Ceti contributors\n-/\nmodule\n\npublic import Mathlib.LinearAlgebra.TensorProduct.Pi\npublic import Mathlib.NumberTheory.Padics.PadicIntegers\npublic import Mathlib.NumberTheory.Padics.ProperSpace\npublic import Mathlib.RingTheory.RootsOfUnity.AlgebraicallyClosed\npublic import TauCeti.NumberTheory.Padics.Basic\npublic import TauCeti.FieldTheory.Galois.AbsoluteGaloisGroup.Cyclotomic.Character\npublic import TauCeti.RepresentationTheory.Continuous.IntegralModel.Reduction\npublic import TauCeti.RepresentationTheory.Continuous.Reduction\npublic import TauCeti.Topology.Algebra.Ring.Compact\nimport TauCeti.NumberTheory.Padics.RingHoms\n\n/-!\n# Examples for the raw reduction of a continuous representation\n\nGive the residue field `\ud835\udd3d_\u2113 = \u2124_\u2113 \u29f8 \u2113` of `\u2124_\u2113` the discrete topology; the residue map is\ncontinuous because the maximal ideal of `\u2124_\u2113` is open (`IsLocalRing.continuous_residue`). Let\n`\u2124` (discrete) act on `\u211a_\u2113\u00b2` through the unipotent matrix `(1 a; 0 1)` with `a \u2208 \u2124_\u2113^\u00d7`. The\nstable lattice `\u2124_\u2113\u00b2` has the action `n \u21a6 (1 na; 0 1)` in its standard basis, and the stable\nlattice `\u2124_\u2113 e\u2081 \u2295 \u2113\u2124_\u2113 e\u2082` has the action `n \u21a6 (1 \u2113na; 0 1)` in its basis `e\u2081, \u2113 e\u2082`. The\ninclusion of the second lattice in the first, `diag(1, \u2113)` in these bases, becomes an isomorphism\nafter extending scalars to `\u211a_\u2113`, so both are lattices of the same `\u211a_\u2113`-representation. Their\nraw reductions are not isomorphic: the first is a non-trivial unipotent representation of `\u2124` on\n`\ud835\udd3d_\u2113\u00b2`, the second is trivial. So the raw reduction depends on the lattice, and no\nsemisimplification is applied. In particular the two lattices are not isomorphic over `\u2124_\u2113`\n(`isEmpty_iso_unipotent`).\n\nFor a field `K` in which `\u2113` is invertible, any integral model of the line `\u211a_\u2113(1)` of the\n`\u2113`-adic cyclotomic character of `G_K` reduces to the mod `\u2113` cyclotomic character: `g` acts on\nthe reduction by the residue of a natural number `a` with `g \u03b6 = \u03b6 ^ a` for every `\u2113`-th root of\nunity `\u03b6` (`exists_reduction_qlOne`).\n-/\n\npublic section\n\nnoncomputable section\n\nopen IsLocalRing TensorProduct\n\nnamespace TauCeti.ContinuousRep.ReductionCheck\n\nvariable (\u2113 : \u2115) [Fact \u2113.Prime]\n\n/-- The residue field of `\u2124_\u2113` with the discrete topology. -/\nlocal instance : TopologicalSpace (ResidueField \u2124_[\u2113]) := \u22a5\n\nlocal instance : DiscreteTopology (ResidueField \u2124_[\u2113]) := \u27e8rfl\u27e9\n\nlocal instance : ContinuousSMul \u2124_[\u2113] (ResidueField \u2124_[\u2113]) :=\n continuousSMul_of_algebraMap _ _ (by\n simpa only [ResidueField.algebraMap_eq] using continuous_residue (isOpen_maximalIdeal \u2124_[\u2113]))\n\n/-- The module topology on the reduction `\ud835\udd3d_\u2113 \u2297 M` of a `\u2124_\u2113`-module. -/\nlocal instance (M : Type*) [AddCommGroup M] [Module \u2124_[\u2113] M] :\n TopologicalSpace (ResidueField \u2124_[\u2113] \u2297[\u2124_[\u2113]] M) :=\n moduleTopology (ResidueField \u2124_[\u2113]) _\n\nlocal instance (M : Type*) [AddCommGroup M] [Module \u2124_[\u2113] M] :\n IsModuleTopology (ResidueField \u2124_[\u2113]) (ResidueField \u2124_[\u2113] \u2297[\u2124_[\u2113]] M) :=\n \u27e8rfl\u27e9\n\n/-- The module topology on `\u211a_\u2113 \u2297 \u2124_\u2113\u00b2`. -/\nlocal instance : TopologicalSpace (\u211a_[\u2113] \u2297[\u2124_[\u2113]] (Fin 2 \u2192 \u2124_[\u2113])) :=\n moduleTopology \u211a_[\u2113] _\n\nlocal instance : IsModuleTopology \u211a_[\u2113] (\u211a_[\u2113] \u2297[\u2124_[\u2113]] (Fin 2 \u2192 \u2124_[\u2113])) :=\n \u27e8rfl\u27e9\n\n/-- The representation `n \u21a6 (1 nb; 0 1)` of `\u2124`, written multiplicatively, on `\u2124_\u2113\u00b2`. -/\ndef unipotentRep (b : \u2124_[\u2113]) : Representation \u2124_[\u2113] (Multiplicative \u2124) (Fin 2 \u2192 \u2124_[\u2113]) where\n toFun n := (!![1, (n.toAdd : \u2124_[\u2113]) * b; 0, 1]).mulVecLin\n map_one' := by simp [\u2190 Matrix.one_fin_two, Module.End.one_eq_id]\n map_mul' m n := by\n rw [Module.End.mul_eq_comp, \u2190 Matrix.mulVecLin_mul, Matrix.mul_fin_two]\n simp [add_mul, add_comm]\n\n/-- The continuous representation `n \u21a6 (1 nb; 0 1)` of the discrete group `\u2124` on `\u2124_\u2113\u00b2`. -/\ndef unipotent (b : \u2124_[\u2113]) : ContinuousRep (Multiplicative \u2124) \u2124_[\u2113] (Fin 2 \u2192 \u2124_[\u2113]) where\n toRepresentation := unipotentRep \u2113 b\n continuous_action := continuous_prod_of_discrete_left.2 fun g \u21a6\n IsModuleTopology.continuous_of_linearMap (R := \u2124_[\u2113]) (unipotentRep \u2113 b g)\n\ntheorem unipotent_apply (b : \u2124_[\u2113]) (n : Multiplicative \u2124) (v : Fin 2 \u2192 \u2124_[\u2113]) :\n unipotent \u2113 b n v = ![v 0 + (n.toAdd : \u2124_[\u2113]) * b * v 1, v 1] := by\n ext i\n fin_cases i <;> simp [unipotent, unipotentRep, Matrix.mulVec, dotProduct, Fin.sum_univ_two]\n\n/-- **The two lattices span the same `\u211a_\u2113`-representation**: the inclusion of\n`\u2124_\u2113 e\u2081 \u2295 \u2113\u2124_\u2113 e\u2082` in `\u2124_\u2113\u00b2`, which is `diag(1, \u2113)` from the basis `e\u2081, \u2113 e\u2082` to `e\u2081, e\u2082`,\nintertwines `unipotent (\u2113 * b)` with `unipotent b` and becomes an isomorphism over `\u211a_\u2113`. -/\ntheorem nonempty_iso_baseChange_unipotent (b : \u2124_[\u2113]) :\n Nonempty (Iso ((unipotent \u2113 (\u2113 * b)).baseChange \u211a_[\u2113]) ((unipotent \u2113 b).baseChange \u211a_[\u2113])) := by\n -- `diag(1, \u2113)` and `diag(\u2113, 1)` intertwine the two actions and compose to `\u2113` either way.\n let f : (unipotent \u2113 (\u2113 * b)).toRepresentation.IntertwiningMap\n (unipotent \u2113 b).toRepresentation :=\n \u27e8(Matrix.diagonal ![1, (\u2113 : \u2124_[\u2113])]).mulVecLin, fun n \u21a6 LinearMap.ext fun v \u21a6 by\n ext i; fin_cases i <;>\n simp [unipotent_apply, Matrix.mulVec_diagonal, mul_add, mul_assoc, mul_left_comm]\u27e9\n let g : (unipotent \u2113 b).toRepresentation.IntertwiningMap\n (unipotent \u2113 (\u2113 * b)).toRepresentation :=\n \u27e8(Matrix.diagonal ![(\u2113 : \u2124_[\u2113]), 1]).mulVecLin, fun n \u21a6 LinearMap.ext fun v \u21a6 by\n ext i; fin_cases i <;>\n simp [unipotent_apply, Matrix.mulVec_diagonal, mul_add, mul_assoc, mul_left_comm]\u27e9\n have hgf (v : Fin 2 \u2192 \u2124_[\u2113]) : g (f v) = (\u2113 : \u2124_[\u2113]) \u2022 v := by\n ext i; fin_cases i <;> simp [f, g, Matrix.mulVec_diagonal]\n have hfg (v : Fin 2 \u2192 \u2124_[\u2113]) : f (g v) = (\u2113 : \u2124_[\u2113]) \u2022 v := by\n ext i; fin_cases i <;> simp [f, g, Matrix.mulVec_diagonal]\n have h\u2113 : IsUnit (algebraMap \u2124_[\u2113] \u211a_[\u2113] \u2113) := by\n simpa using (Fact.out : \u2113.Prime).ne_zero\n have e := (f.baseChange \u211a_[\u2113]).ofBijective\n (Representation.IntertwiningMap.baseChange_bijective_of_comp_eq_smul hgf hfg _ h\u2113 h\u2113)\n rw [\u2190 toRepresentation_baseChange, \u2190 toRepresentation_baseChange] at e\n exact \u27e8.ofEquiv e\u27e9\n\n/-- The identification `\ud835\udd3d_\u2113 \u2297 \u2124_\u2113\u00b2 \u2245 \ud835\udd3d_\u2113\u00b2`. -/\nnoncomputable abbrev coords : ResidueField \u2124_[\u2113] \u2297[\u2124_[\u2113]] (Fin 2 \u2192 \u2124_[\u2113]) \u2243\u2097[ResidueField \u2124_[\u2113]]\n (Fin 2 \u2192 ResidueField \u2124_[\u2113]) :=\n piScalarRight \u2124_[\u2113] (ResidueField \u2124_[\u2113]) (ResidueField \u2124_[\u2113]) (Fin 2)\n\n/-- In coordinates, the reduction of `unipotent b` acts by `(1 n\u00b7b; 0 1)` with `b`\nreduced modulo `\u2113`. -/\ntheorem coords_reduction_unipotent (b : \u2124_[\u2113]) (n : Multiplicative \u2124)\n (x : ResidueField \u2124_[\u2113] \u2297[\u2124_[\u2113]] (Fin 2 \u2192 \u2124_[\u2113])) :\n coords \u2113 ((unipotent \u2113 b).reduction n x) =\n ![coords \u2113 x 0 + (n.toAdd : ResidueField \u2124_[\u2113]) * residue \u2124_[\u2113] b * coords \u2113 x 1,\n coords \u2113 x 1] := by\n induction x using TensorProduct.inductionOn with\n | tmul c v =>\n ext i\n fin_cases i <;> simp [reduction, baseChange_apply, unipotent_apply, Algebra.smul_def,\n ResidueField.algebraMap_eq, mul_add, mul_comm, mul_left_comm]\n | add x y hx hy =>\n simp only [map_add, hx, hy]\n ext i\n fin_cases i <;> simp [mul_add, add_add_add_comm]\n\n/-- **The lattice `\u2124_\u2113\u00b2` reduces to a non-trivial representation**: for a unit `a`, the\ngenerator of `\u2124` does not act trivially on the reduction of `(1 a; 0 1)`. -/\ntheorem reduction_unipotent_ne_one {a : \u2124_[\u2113]} (ha : IsUnit a) :\n (unipotent \u2113 a).reduction (Multiplicative.ofAdd 1) \u2260 1 := by\n intro h\n have h' := congr_arg (fun f \u21a6 coords \u2113 (f ((coords \u2113).symm ![0, 1])) 0) h\n simp only [coords_reduction_unipotent, LinearEquiv.apply_symm_apply, one_apply_eq_self] at h'\n simp only [Matrix.cons_val_zero, Matrix.cons_val_one, toAdd_ofAdd,\n Int.cast_one, one_mul, mul_one, zero_add] at h'\n exact (ha.map (residue \u2124_[\u2113])).ne_zero h'\n\n/-- **The lattice `\u2124_\u2113 e\u2081 \u2295 \u2113\u2124_\u2113 e\u2082` reduces to the trivial representation**: in the basis\n`e\u2081, \u2113 e\u2082` the action is `(1 \u2113a; 0 1)`, and `\u2113` vanishes in `\ud835\udd3d_\u2113`. -/\ntheorem reduction_unipotent_ell_mul_eq_one (a : \u2124_[\u2113]) (n : Multiplicative \u2124) :\n (unipotent \u2113 (\u2113 * a)).reduction n = 1 := by\n refine LinearMap.ext fun x \u21a6 (coords \u2113).injective ?_\n have h\u2113 : residue \u2124_[\u2113] ((\u2113 : \u2124_[\u2113]) * a) = 0 := by\n rw [residue_eq_zero_iff]\n exact Ideal.mul_mem_right _ _ (by simp [PadicInt.maximalIdeal_eq_span_p])\n rw [coords_reduction_unipotent, h\u2113]\n ext i\n fin_cases i <;> simp\n\n/-- The raw reductions of the two lattices are not isomorphic, although the lattices span\nisomorphic `\u211a_\u2113`-representations (`nonempty_iso_baseChange_unipotent`). -/\ntheorem isEmpty_iso_reduction {a : \u2124_[\u2113]} (ha : IsUnit a) :\n IsEmpty (Iso (unipotent \u2113 a).reduction (unipotent \u2113 (\u2113 * a)).reduction) := by\n refine \u27e8fun e \u21a6 reduction_unipotent_ne_one \u2113 ha (LinearMap.ext fun x \u21a6 EquivLike.injective e ?_)\u27e9\n rw [e.isIntertwining, reduction_unipotent_ell_mul_eq_one, one_apply_eq_self, one_apply_eq_self]\n\n/-- **The two lattices are not isomorphic over `\u2124_\u2113`**, although they become isomorphic over `\u211a_\u2113`\n(`nonempty_iso_baseChange_unipotent`): an isomorphism would reduce to an isomorphism of the raw\nreductions, which `isEmpty_iso_reduction` excludes. So isomorphism over `\u2124_\u2113` is not conjugacy\nover the fraction field. -/\ntheorem isEmpty_iso_unipotent {a : \u2124_[\u2113]} (ha : IsUnit a) :\n IsEmpty (Iso (unipotent \u2113 a) (unipotent \u2113 (\u2113 * a))) :=\n \u27e8fun e \u21a6 (isEmpty_iso_reduction \u2113 ha).false (e.baseChange (ResidueField \u2124_[\u2113]))\u27e9\n\n/-! ### Models of `\u211a_\u2113(1)` -/\n\nsection Cyclotomic\n\nvariable (K : Type*) [Field K] [NeZero (\u2113 : K)]\n\n/-- The line `\u211a_\u2113(1)`: the absolute Galois group of `K` acting on `\u211a_\u2113` through the `\u2113`-adic\ncyclotomic character. -/\nabbrev qlOne : ContinuousRep (Field.absoluteGaloisGroup K) \u211a_[\u2113] \u211a_[\u2113] :=\n ofCharacter (unitsMapCharacter \u211a_[\u2113] (continuousLocalCyclotomicCharacter \u2113 K))\n\n", "statement": "/-- **Any model of `\u211a_\u2113(1)` reduces to the mod `\u2113` cyclotomic character.** For an integral model\n`\u039b` of `\u211a_\u2113(1)` (with its `\u2124_\u2113`-module topology) and `g \u2208 G_K`, there is a natural number `a`\nwith `g \u03b6 = \u03b6 ^ a` for every `\u2113`-th root of unity `\u03b6` in `K^alg`, and `g` acts on the reduction\nof `\u039b` by `a mod \u2113`. -/\ntheorem exists_reduction_qlOne (\u039b : GaloisLattice.IntegralModel \u2124_[\u2113] (qlOne \u2113 K))\n [IsModuleTopology \u2124_[\u2113] \u039b.lattice] (g : Field.absoluteGaloisGroup K) :\n \u2203 a : \u2115, (\u2200 \u03b6 : AlgebraicClosure K, \u03b6 ^ \u2113 = 1 \u2192 g.toRingEquiv \u03b6 = \u03b6 ^ a) \u2227\n \u2200 y, \u039b.toContinuousRep.reduction g y = (a : ResidueField \u2124_[\u2113]) \u2022 y ", "proof": " by\n set u : \u2124_[\u2113] := (localCyclotomicCharacter \u2113 K g : \u2124_[\u2113])\n refine \u27e8u.appr 1, fun \u03b6 h\u03b6 \u21a6 ?_, fun y \u21a6 ?_\u27e9\n \u00b7 have (i : \u2115) : HasEnoughRootsOfUnity (AlgebraicClosure K) (\u2113 ^ i) :=\n AlgebraicClosure.hasEnoughRootsOfUnity_pow K \u2113 i\n simpa only [u, localCyclotomicCharacter_apply, PadicInt.val_toZModPow_eq_appr] using\n cyclotomicCharacter.spec \u2113 (n := 1) g.toRingEquiv \u03b6 (by rwa [pow_one])\n \u00b7 rw [\u039b.reduction_toContinuousRep_ofCharacter_apply (c := u) (by simp [u]),\n \u2190 map_natCast (residue \u2124_[\u2113])]\n congr 1\n exact Ideal.Quotient.eq.2 <| by\n simpa [PadicInt.maximalIdeal_eq_span_p] using PadicInt.appr_spec 1 u", "proof_lines": 11, "proof_length": 597, "rev": "75c8aed5fea63047615a25a9763fd5b68a86e891", "heartbeats": 2462, "image": "lean-compression:tauceti-75c8aed5fe-a608030cfc", "split": "dev"} {"path": "TauCeti/Algebra/Homology/Curved/Module/Right/Cone/Basic.lean", "module": "TauCeti.Algebra.Homology.Curved.Module.Right.Cone.Basic", "theorem": "TauCeti.CurvedDGRightModuleCat.coneContraction_boundary", "prefix": "/-\nCopyright (c) 2026 Wentao Li. All rights reserved.\nReleased under Apache 2.0 license as described in the file LICENSE.\nAuthors: Wentao Li\n-/\nmodule\n\npublic import TauCeti.Algebra.Homology.Curved.Module.Right.Biproduct\npublic import TauCeti.Algebra.Homology.Curved.Module.Right.Homotopy\npublic import TauCeti.Algebra.Homology.Curved.Module.Right.Shift\npublic import TauCeti.Algebra.Homology.SquareZero\n\n/-!\n# Mapping cones of curved differential graded right modules\n\nThe cone of a closed map `f : M \u27f6 N` has underlying graded right module `M[1] \u00d7 N` and\ndifferential `(x, y) \u21a6 (-dM x, f x + dN y)`. The two off-diagonal terms in its square cancel\nbecause `f` commutes with the differentials. Its curvature is therefore the same as the\ncurvature of `M` and `N`, without a centrality assumption.\n\nThe right action is unchanged. The canonical inclusion of `N` and projection to `M[1]` are\nclosed maps, and the adjacent composites vanish in the existing homotopy category. A closed map\n`g : N \u27f6 P` with `f \u226b g = 0` induces the closed map `coneDesc f g hfg : cone(f) \u27f6 P`.\nA null-homotopic closed map factors through its source's identity cone via the inclusion.\n\n## References\n\n* L. Positselski, *Differential graded Koszul duality: an introductory survey*, Sections 6.2\n and 7.6. His curvature is the negative of the right-module curvature stored here.\n* The Tau Ceti contributors, `TauCeti.Algebra.Homology.Curved.Cone.Basic`: the curved-duplex\n cone formalization is the precedent for the cone, its maps and its contraction interface.\n* The Tau Ceti contributors, `TauCeti.Algebra.Homology.Curved.Frobenius`: the identity-cone\n factorization adapts the corresponding componentwise split construction.\n-/\n\npublic section\n\nopen CategoryTheory MulOpposite\n\nnamespace TauCeti.CurvedDGRightModuleCat\n\nuniverse u\n\n-- The closed category retains its enriched object carriers.\nattribute [local implicit_reducible] ForgetEnrichment EnrichedFunctor.ofDGMap\n\nvariable {R A : Type u} [CommRing R] [Ring A] [Algebra R A]\n {\ud835\udc9c : \u2124 \u2192 Submodule R A} [GradedAlgebra \ud835\udc9c] {d : A \u2192\u2097[R] A} {w : A}\n {h : IsCurvedDGAlgebra \ud835\udc9c d w} {M N : CurvedDGRightModuleCat.{u, u, u} h}\n\nvariable (f : ForgetEnrichment.of (CochainComplex (ModuleCat R) \u2124) M \u27f6\n ForgetEnrichment.of (CochainComplex (ModuleCat R) \u2124) N)\n\n/-- The cone differential uses the linear mapping-cone construction on the ground-ring maps. -/\nnoncomputable def coneDifferential : M \u00d7 N \u2192\u2097[R] M \u00d7 N :=\n LinearMap.mappingCone M.differential N.differential ((closedHom f).restrictScalars R)\n\n/-- The cone differential has diagonal entries `-dM` and `dN` and lower-left entry `f`. -/\n@[simp]\ntheorem coneDifferential_apply (x : M \u00d7 N) :\n coneDifferential f x = (-M.differential x.1, closedHom f x.1 + N.differential x.2) := by\n simp only [coneDifferential, LinearMap.mappingCone_apply, LinearMap.restrictScalars_apply]\n\n/-- The cone of a closed map, with grading `M[1] \u00d7 N` and the original curvature. -/\n@[expose, implicit_reducible]\nnoncomputable def cone : CurvedDGRightModuleCat.{u, u, u} h := by\n let P := (M.shift 1).prod N\n letI : DirectSum.Decomposition P.grading := P.decomposition\n letI : SetLike.GradedSMul (InternalGrading.ofDecomposition \ud835\udc9c).opposite.piece P.grading :=\n P.gradedSMul\n refine\n { carrier := M \u00d7 N\n grading := P.grading\n differential := coneDifferential f\n isCurvedDGRightModule := ?_ }\n refine \u27e8?_, ?_, ?_\u27e9\n \u00b7 apply LinearMap.isHomogeneous_def.mpr\n intro p x hx\n simp only [P, prod_grading, shift_grading, Submodule.mem_prod] at hx \u22a2\n rw [coneDifferential_apply]\n exact \u27e8(M.grading ((p + 1) + 1)).neg_mem\n (M.isCurvedDGRightModule.isHomogeneous.map_mem hx.1),\n (N.grading (p + 1)).add_mem (closedHom_mem f hx.1)\n (N.isCurvedDGRightModule.isHomogeneous.map_mem hx.2)\u27e9\n \u00b7 intro p x hx a\n simp only [P, prod_grading, shift_grading, Submodule.mem_prod] at hx\n simp only [coneDifferential_apply]\n apply Prod.ext\n \u00b7 -- The cone inherits the product action, so its first component is the original\n -- action on `M`; the shift changes the grading and differential only.\n change -M.differential (op a \u2022 x.1) =\n op a \u2022 (-M.differential x.1) + p.negOnePow \u2022 (op (d a) \u2022 x.1)\n rw [M.isCurvedDGRightModule.leibniz hx.1 a, Int.negOnePow_add, Int.negOnePow_one]\n simp [add_comm]\n \u00b7 -- The second component inherits the action on `N`. This reduction aligns the\n -- bundled cone's action with the componentwise right-linear and Leibniz formulas.\n change closedHom f (op a \u2022 x.1) + N.differential (op a \u2022 x.2) =\n op a \u2022 (closedHom f x.1 + N.differential x.2) +\n p.negOnePow \u2022 (op (d a) \u2022 x.2)\n rw [map_smul, N.isCurvedDGRightModule.leibniz hx.2 a, smul_add]\n abel\n \u00b7 intro x\n simp only [coneDifferential_apply, map_neg, map_add, differential_closedHom,\n M.isCurvedDGRightModule.sq_eq, N.isCurvedDGRightModule.sq_eq, neg_neg,\n neg_add_cancel_left]\n -- The square is right multiplication by the same curvature in both components;\n -- the inherited product action computes componentwise on the bundled cone.\n rfl\n\n/-- The degree-`p` part of the cone is `M\u1d56\u207a\u00b9 \u00d7 N\u1d56`. -/\n@[simp]\ntheorem cone_grading (p : \u2124) :\n (cone f).grading p = (M.grading (p + 1)).prod (N.grading p) := by\n simp only [cone, prod_grading, shift_grading]\n\n/-- The differential on the cone acts by the usual block formula. -/\n@[simp]\ntheorem cone_differential_apply (x : M \u00d7 N) :\n (cone f).differential x = (-M.differential x.1, closedHom f x.1 + N.differential x.2) :=\n coneDifferential_apply f x\n\n/-- The closed inclusion of the codomain into its cone. -/\nnoncomputable def coneInclusion :\n ForgetEnrichment.of (CochainComplex (ModuleCat R) \u2124) N \u27f6\n ForgetEnrichment.of (CochainComplex (ModuleCat R) \u2124) (cone f) :=\n closedHomOf (LinearMap.inr A\u1d50\u1d52\u1d56 M N)\n (fun p x hx \u21a6 by rw [cone_grading]; exact \u27e8(M.grading (p + 1)).zero_mem, hx\u27e9)\n (fun x \u21a6 by\n -- The right-linear inclusion is the second inclusion of the cone's product carrier.\n change (cone f).differential (0, x) = (0, N.differential x)\n rw [cone_differential_apply]\n simp)\n\n/-- The closed projection from the cone to the cohomological shift of its domain. -/\nnoncomputable def coneProjection :\n ForgetEnrichment.of (CochainComplex (ModuleCat R) \u2124) (cone f) \u27f6\n ForgetEnrichment.of (CochainComplex (ModuleCat R) \u2124) (M.shift 1) :=\n closedHomOf (LinearMap.fst A\u1d50\u1d52\u1d56 M N)\n (fun p x hx \u21a6 by rw [cone_grading] at hx; rw [shift_grading]; exact hx.1)\n (fun x \u21a6 by\n -- Evaluate the first projection before comparing the two differential formulas.\n change (M.shift 1).differential x.1 = ((cone f).differential x).1\n rw [shift_one_differential_apply, cone_differential_apply])\n\n/-- The cone inclusion is the usual second linear inclusion. -/\n@[simp]\ntheorem closedHom_coneInclusion : closedHom (coneInclusion f) = LinearMap.inr A\u1d50\u1d52\u1d56 M N := by\n dsimp only [coneInclusion]\n exact closedHom_closedHomOf _ _ _\n\n/-- The cone projection is the usual first linear projection. -/\n@[simp]\ntheorem closedHom_coneProjection : closedHom (coneProjection f) = LinearMap.fst A\u1d50\u1d52\u1d56 M N := by\n dsimp only [coneProjection]\n exact closedHom_closedHomOf _ _ _\n\n/-- The inclusion followed by the projection vanishes already in the closed category. -/\n@[reassoc (attr := simp), simp]\ntheorem coneInclusion_comp_coneProjection : coneInclusion f \u226b coneProjection f = 0 := by\n apply closedHom_ext\n intro x\n simp only [closedHom_comp, closedHom_coneInclusion, closedHom_coneProjection, closedHom_zero]\n rfl\n\nsection ConeDesc\n\nvariable {P : CurvedDGRightModuleCat.{u, u, u} h}\n (g : ForgetEnrichment.of (CochainComplex (ModuleCat R) \u2124) N \u27f6\n ForgetEnrichment.of (CochainComplex (ModuleCat R) \u2124) P)\n (hfg : f \u226b g = 0)\n\n/-- A closed map `g` killing the closed map `f` induces the closed map `cone(f) \u27f6 P`\nsending `(x, y)` to `g y`. -/\nnoncomputable def coneDesc :\n ForgetEnrichment.of (CochainComplex (ModuleCat R) \u2124) (cone f) \u27f6\n ForgetEnrichment.of (CochainComplex (ModuleCat R) \u2124) P :=\n closedHomOf ((closedHom g).comp (LinearMap.snd A\u1d50\u1d52\u1d56 M N))\n (fun p x hx \u21a6 by rw [cone_grading] at hx; exact closedHom_mem g hx.2)\n (fun x \u21a6 by\n have hx : closedHom g (closedHom f x.1) = 0 := by\n rw [\u2190 LinearMap.comp_apply, \u2190 closedHom_comp, hfg, closedHom_zero, LinearMap.zero_apply]\n -- Evaluate the second projection on the cone's product carrier.\n change P.differential (closedHom g x.2) = closedHom g ((cone f).differential x).2\n rw [cone_differential_apply, map_add, hx, zero_add, differential_closedHom])\n\n/-- The map out of the cone applies `g` to the second component. -/\n@[simp]\ntheorem closedHom_coneDesc :\n closedHom (coneDesc f g hfg) = (closedHom g).comp (LinearMap.snd A\u1d50\u1d52\u1d56 M N) :=\n closedHom_closedHomOf _ _ _\n\n/-- The differential of the iterated cone on its three components. This is the differential\nused in the totalization of a short complex. -/\ntheorem cone_coneDesc_differential_apply (x : M) (y : N) (z : P) :\n (cone (coneDesc f g hfg)).differential ((x, y), z) =\n ((M.differential x, -closedHom f x - N.differential y),\n closedHom g y + P.differential z) := by\n rw [cone_differential_apply, cone_differential_apply, closedHom_coneDesc]\n -- Cone carriers have componentwise product operations; expose their projections here.\n change ((- -M.differential x, -(closedHom f x + N.differential y)),\n closedHom g y + P.differential z) = _\n simp only [neg_neg, neg_add, sub_eq_add_neg]\n\n/-- The cone inclusion followed by the induced map out of the cone is the original map. -/\n@[reassoc (attr := simp)]\ntheorem coneInclusion_comp_coneDesc : coneInclusion f \u226b coneDesc f g hfg = g := by\n apply closedHom_ext\n intro x\n rw [closedHom_comp, closedHom_coneDesc, closedHom_coneInclusion]\n -- Evaluate the second projection after the second inclusion on the cone's product carrier.\n rfl\n\nend ConeDesc\n\n/-- The first linear inclusion, viewed as a degree-minus-one homotopy into the cone. -/\nnoncomputable def coneInclusionHomotopy :\n dgRightModuleCochains (R := R) (A := A) (\u2133 := M.grading) (\u2133N := (cone f).grading) (-1) := by\n refine \u27e8LinearMap.inl A\u1d50\u1d52\u1d56 M N, dgRightModuleCochains.mem_iff.mpr ?_\u27e9\n apply LinearMap.isHomogeneous_def.mpr\n intro p x hx\n rw [cone_grading]\n -- Evaluate the first linear inclusion; degree minus one cancels the cone's domain shift.\n change (x, 0) \u2208 (M.grading ((p + -1) + 1)).prod (N.grading (p + -1))\n simpa using And.intro hx ((N.grading (p + -1)).zero_mem)\n\n/-- The homotopy for the first adjacent composite sends `x` to `(x, 0)`. -/\n@[simp]\ntheorem coneInclusionHomotopy_apply (x : M) : (coneInclusionHomotopy f).val x = (x, 0) :=\n (rfl)\n\n/-- The first adjacent composite is the boundary of the first inclusion homotopy. -/\ntheorem comp_coneInclusion_boundary (x : M) :\n closedHom (f \u226b coneInclusion f) x =\n (cone f).differential ((coneInclusionHomotopy f).val x) +\n (coneInclusionHomotopy f).val (M.differential x) := by\n rw [closedHom_comp, LinearMap.comp_apply, closedHom_coneInclusion]\n simp only [coneInclusionHomotopy_apply, cone_differential_apply, map_zero, add_zero]\n -- The bundled cone inherits the product addition, so the boundary is componentwise.\n change (0, closedHom f x) = (-M.differential x, closedHom f x) + (M.differential x, 0)\n exact Prod.ext (neg_add_cancel _).symm (add_zero _).symm\n\n/-- The second projection, viewed as a degree-minus-one homotopy to the shifted codomain. -/\nnoncomputable def coneProjectionHomotopy :\n dgRightModuleCochains (R := R) (A := A) (\u2133 := (cone f).grading)\n (\u2133N := (N.shift 1).grading) (-1) := by\n refine \u27e8LinearMap.snd A\u1d50\u1d52\u1d56 M N, dgRightModuleCochains.mem_iff.mpr ?_\u27e9\n apply LinearMap.isHomogeneous_def.mpr\n intro p x hx\n rw [cone_grading] at hx\n rw [shift_grading]\n -- Evaluate the second linear projection into the shifted codomain's homogeneous piece.\n change x.2 \u2208 N.grading ((p + -1) + 1)\n simpa using hx.2\n\n/-- The homotopy for the third adjacent composite sends `(x, y)` to `y`. -/\n@[simp]\ntheorem coneProjectionHomotopy_apply (x : M \u00d7 N) : (coneProjectionHomotopy f).val x = x.2 :=\n (rfl)\n\n/-- The projection followed by the shifted map is the boundary of the second projection. -/\ntheorem coneProjection_comp_shift_boundary (x : M \u00d7 N) :\n closedHom (coneProjection f \u226b (closedShiftFunctor 1).map f) x =\n (N.shift 1).differential ((coneProjectionHomotopy f).val x) +\n (coneProjectionHomotopy f).val ((cone f).differential x) := by\n simp only [closedHom_comp, closedHom_coneProjection, closedHom_closedShiftFunctor_map,\n LinearMap.comp_apply, coneProjectionHomotopy_apply, cone_differential_apply,\n shift_one_differential_apply]\n -- Evaluate the first projection and the degree-zero shifted map on the product carrier.\n change closedHom f x.1 = -N.differential x.2 + (closedHom f x.1 + N.differential x.2)\n abel\n\n-- The quotient keeps the objects, so its map has the same closed representative.\nattribute [local implicit_reducible] dgClosedToHomotopy\n DGHomotopyCategory.of DGHomotopyCategory.underlying\n\n/-- The first adjacent composite vanishes in the curved homotopy category. -/\n-- Reduce the zero composite before dgClosedToHomotopy_map expands its representatives.\n@[reassoc (attr := simp\u2193), simp\u2193]\ntheorem quotient_map_comp_coneInclusion :\n (dgClosedToHomotopy R).map f \u226b (dgClosedToHomotopy R).map (coneInclusion f) = 0 := by\n rw [\u2190 Functor.map_comp, dgClosedToHomotopy_map_eq_zero_iff, mem_dgBoundaries_iff]\n refine \u27e8coneInclusionHomotopy f, fun x \u21a6 ?_\u27e9\n rw [\u2190 closedHom_eq]\n exact comp_coneInclusion_boundary f x\n\n/-- The third adjacent composite also vanishes in the curved homotopy category. -/\n-- Reduce the zero composite before dgClosedToHomotopy_map expands its representatives.\n@[reassoc (attr := simp\u2193), simp\u2193]\ntheorem quotient_map_coneProjection_comp_shift :\n (dgClosedToHomotopy R).map (coneProjection f) \u226b\n (dgClosedToHomotopy R).map ((closedShiftFunctor 1).map f) = 0 := by\n rw [\u2190 Functor.map_comp, dgClosedToHomotopy_map_eq_zero_iff, mem_dgBoundaries_iff]\n refine \u27e8coneProjectionHomotopy f, fun x \u21a6 ?_\u27e9\n rw [\u2190 closedHom_eq]\n exact coneProjection_comp_shift_boundary f x\n\n/-- The contracting homotopy of the cone of an isomorphism applies its inverse to the\nsecond component and includes the result into the first component. -/\nnoncomputable def coneContraction [IsIso f] :\n dgRightModuleCochains (R := R) (A := A) (\u2133 := (cone f).grading)\n (\u2133N := (cone f).grading) (-1) := by\n refine \u27e8(LinearMap.inl A\u1d50\u1d52\u1d56 M N).comp\n ((closedHom (inv f)).comp (LinearMap.snd A\u1d50\u1d52\u1d56 M N)),\n dgRightModuleCochains.mem_iff.mpr ?_\u27e9\n apply LinearMap.isHomogeneous_def.mpr\n intro p x hx\n rw [cone_grading] at hx \u22a2\n -- Evaluate the composed projection, inverse and inclusion on the product carrier.\n change (closedHom (inv f) x.2, 0) \u2208\n (M.grading ((p + -1) + 1)).prod (N.grading (p + -1))\n simpa using And.intro (closedHom_mem (inv f) hx.2) ((N.grading (p + -1)).zero_mem)\n\n/-- The contraction sends `(x, y)` to `(f\u207b\u00b9 y, 0)`. -/\n@[simp]\ntheorem coneContraction_apply [IsIso f] (x : M \u00d7 N) :\n (coneContraction f).val x = (closedHom (inv f) x.2, 0) :=\n (rfl)\n\nvariable\n (g : ForgetEnrichment.of (CochainComplex (ModuleCat R) \u2124) N \u27f6\n ForgetEnrichment.of (CochainComplex (ModuleCat R) \u2124) M)\n (\u03b1 : dgRightModuleCochains (R := R) (A := A) (\u2133 := M.grading) (\u2133N := M.grading) (-1))\n (\u03b2 : dgRightModuleCochains (R := R) (A := A) (\u2133 := N.grading) (\u2133N := N.grading) (-1))\n\n/-- A corrected degree-minus-one cochain for a closed map `g` and cochains `\u03b1`, `\u03b2`.\nFor `t = f \u2218 \u03b1 - \u03b2 \u2218 f`, its matrix is `(\u03b1 - g \u2218 t, g; \u03b2 \u2218 t, -\u03b2)`.\nIt is a contraction when the inverse-homotopy equations in\n`coneHomotopyContraction_boundary` hold. -/\nnoncomputable def coneHomotopyContraction :\n dgRightModuleCochains (R := R) (A := A) (\u2133 := (cone f).grading)\n (\u2133N := (cone f).grading) (-1) := by\n let t : M \u2192\u2097[A\u1d50\u1d52\u1d56] N := (closedHom f).comp \u03b1.val - \u03b2.val.comp (closedHom f)\n refine \u27e8((\u03b1.val.comp (LinearMap.fst A\u1d50\u1d52\u1d56 M N) -\n (closedHom g).comp (t.comp (LinearMap.fst A\u1d50\u1d52\u1d56 M N))) +\n (closedHom g).comp (LinearMap.snd A\u1d50\u1d52\u1d56 M N)).prod\n (\u03b2.val.comp (t.comp (LinearMap.fst A\u1d50\u1d52\u1d56 M N)) -\n \u03b2.val.comp (LinearMap.snd A\u1d50\u1d52\u1d56 M N)), dgRightModuleCochains.mem_iff.mpr ?_\u27e9\n apply LinearMap.isHomogeneous_def.mpr\n intro p x hx\n rw [cone_grading] at hx \u22a2\n have h\u03b1x : \u03b1.val x.1 \u2208 M.grading p := by\n simpa [add_assoc] using dgRightModuleCochains.map_mem \u03b1 hx.1\n have htx : t x.1 \u2208 N.grading p := by\n dsimp only [t, LinearMap.sub_apply, LinearMap.comp_apply]\n exact (N.grading p).sub_mem (closedHom_mem f h\u03b1x)\n (by simpa [add_assoc] using dgRightModuleCochains.map_mem \u03b2 (closedHom_mem f hx.1))\n -- The block map is evaluated on the product carrier; its first output has degree `p`\n -- in `M`, which is degree `p - 1` in the shifted domain component of the cone.\n change (\u03b1.val x.1 - closedHom g (t x.1) + closedHom g x.2,\n \u03b2.val (t x.1) - \u03b2.val x.2) \u2208\n (M.grading ((p + -1) + 1)).prod (N.grading (p + -1))\n simpa [add_assoc] using And.intro\n ((M.grading p).add_mem ((M.grading p).sub_mem h\u03b1x (closedHom_mem g htx))\n (closedHom_mem g hx.2))\n ((N.grading (p + -1)).sub_mem (dgRightModuleCochains.map_mem \u03b2 htx)\n (dgRightModuleCochains.map_mem \u03b2 hx.2))\n\n/-- The corrected degree-minus-one cochain has this block formula on the cone carrier. -/\n@[simp]\ntheorem coneHomotopyContraction_apply (x : M \u00d7 N) :\n (coneHomotopyContraction f g \u03b1 \u03b2).val x =\n (\u03b1.val x.1 - closedHom g (closedHom f (\u03b1.val x.1) - \u03b2.val (closedHom f x.1)) +\n closedHom g x.2,\n \u03b2.val (closedHom f (\u03b1.val x.1) - \u03b2.val (closedHom f x.1)) - \u03b2.val x.2) := by\n -- The cochain stores this product linear map; computing its two fields evaluates\n -- the block formula without rewriting through the bundled cone\u2019s module instances.\n dsimp only [coneHomotopyContraction]\n rfl\n\nvariable\n (h\u03b1 : \u2200 x : M, closedHom g (closedHom f x) - x =\n M.differential (\u03b1.val x) + \u03b1.val (M.differential x))\n (h\u03b2 : \u2200 x : N, closedHom f (closedHom g x) - x =\n N.differential (\u03b2.val x) + \u03b2.val (N.differential x))\n\ninclude h\u03b1 h\u03b2 in\n/-- Inverse homotopies make the corrected contraction a boundary of the identity.\nThe correction uses the closed odd map `t = f \u2218 \u03b1 - \u03b2 \u2218 f`, so no coherence between the\nchosen inverse homotopies, or zero-curvature hypothesis, is required. -/\ntheorem coneHomotopyContraction_boundary (x : M \u00d7 N) :\n (cone f).differential ((coneHomotopyContraction f g \u03b1 \u03b2).val x) +\n (coneHomotopyContraction f g \u03b1 \u03b2).val ((cone f).differential x) = x := by\n let t : M \u2192\u2097[A\u1d50\u1d52\u1d56] N := (closedHom f).comp \u03b1.val - \u03b2.val.comp (closedHom f)\n have ht (z : M) : N.differential (t z) + t (M.differential z) = 0 := by\n have h\u2081 := congrArg (closedHom f) (h\u03b1 z)\n simp only [map_sub, map_add] at h\u2081\n have h\u2082 := h\u03b2 (closedHom f z)\n rw [differential_closedHom] at h\u2082\n have heq := h\u2081.symm.trans h\u2082\n dsimp only [t, LinearMap.sub_apply, LinearMap.comp_apply]\n simp only [map_sub, differential_closedHom]\n convert sub_eq_zero.mpr heq using 1\n abel\n have hK (z : M \u00d7 N) : (coneHomotopyContraction f g \u03b1 \u03b2).val z =\n (\u03b1.val z.1 - closedHom g (t z.1) + closedHom g z.2,\n \u03b2.val (t z.1) - \u03b2.val z.2) := by\n simpa only [t, LinearMap.sub_apply, LinearMap.comp_apply] using\n coneHomotopyContraction_apply f g \u03b1 \u03b2 z\n simp only [hK, cone_differential_apply]\n apply Prod.ext\n \u00b7 -- The cone retains product addition; evaluate its first component before the group identities.\n change -M.differential (\u03b1.val x.1 - closedHom g (t x.1) + closedHom g x.2) +\n (\u03b1.val (-M.differential x.1) - closedHom g (t (-M.differential x.1)) +\n closedHom g (closedHom f x.1 + N.differential x.2)) = x.1\n calc\n _ = x.1 + closedHom g (N.differential (t x.1) + t (M.differential x.1)) := by\n simp only [map_add, map_sub, map_neg, differential_closedHom]\n rw [(sub_eq_iff_eq_add).mp (h\u03b1 x.1)]\n abel\n _ = x.1 := by rw [ht, map_zero, add_zero]\n \u00b7 -- Its second component uses the same inherited product addition.\n change closedHom f (\u03b1.val x.1 - closedHom g (t x.1) + closedHom g x.2) +\n N.differential (\u03b2.val (t x.1) - \u03b2.val x.2) +\n (\u03b2.val (t (-M.differential x.1)) -\n \u03b2.val (closedHom f x.1 + N.differential x.2)) = x.2\n calc\n _ = t x.1 - closedHom f (closedHom g (t x.1)) +\n (N.differential (\u03b2.val (t x.1)) + \u03b2.val (N.differential (t x.1))) + x.2 -\n \u03b2.val (N.differential (t x.1) + t (M.differential x.1)) := by\n simp only [map_add, map_sub, map_neg]\n rw [(sub_eq_iff_eq_add).mp (h\u03b2 x.2)]\n dsimp only [t, LinearMap.sub_apply, LinearMap.comp_apply]\n abel\n _ = x.2 := by rw [\u2190 h\u03b2 (t x.1), ht, map_zero]; abel\n\n/-- A closed map which becomes an isomorphism in the homotopy category has a contractible cone. -/\ntheorem isZero_homotopy_cone_isIso [IsIso ((dgClosedToHomotopy R).map f)] :\n CategoryTheory.Limits.IsZero (DGHomotopyCategory.of R (cone f)) := by\n obtain \u27e8g, hg\u27e9 := (dgClosedToHomotopy R).map_surjective (inv ((dgClosedToHomotopy R).map f))\n have hleft : (dgClosedToHomotopy R).map (f \u226b g) =\n (dgClosedToHomotopy R).map (\ud835\udfd9 (ForgetEnrichment.of (CochainComplex (ModuleCat R) \u2124) M)) := by\n rw [CategoryTheory.Functor.map_comp, hg, CategoryTheory.Functor.map_id]\n exact IsIso.hom_inv_id _\n have hright : (dgClosedToHomotopy R).map (g \u226b f) =\n (dgClosedToHomotopy R).map (\ud835\udfd9 (ForgetEnrichment.of (CochainComplex (ModuleCat R) \u2124) N)) := by\n rw [CategoryTheory.Functor.map_comp, hg, CategoryTheory.Functor.map_id]\n exact IsIso.inv_hom_id _\n obtain \u27e8\u03b1, h\u03b1\u27e9 := (quotient_map_eq_iff_exists_homotopy _ _).mp hleft\n obtain \u27e8\u03b2, h\u03b2\u27e9 := (quotient_map_eq_iff_exists_homotopy _ _).mp hright\n have h\u03b1' (z : M) : closedHom g (closedHom f z) - z =\n M.differential (\u03b1.val z) + \u03b1.val (M.differential z) := by\n simpa only [closedHom_comp, closedHom_id, LinearMap.comp_apply, LinearMap.id_apply] using h\u03b1 z\n have h\u03b2' (z : N) : closedHom f (closedHom g z) - z =\n N.differential (\u03b2.val z) + \u03b2.val (N.differential z) := by\n simpa only [closedHom_comp, closedHom_id, LinearMap.comp_apply, LinearMap.id_apply] using h\u03b2 z\n apply (CategoryTheory.Limits.IsZero.iff_id_eq_zero _).mpr\n have hz : (dgClosedToHomotopy R).map\n (\ud835\udfd9 (ForgetEnrichment.of (CochainComplex (ModuleCat R) \u2124) (cone f))) = 0 := by\n rw [dgClosedToHomotopy_map_eq_zero_iff, mem_dgBoundaries_iff]\n refine \u27e8coneHomotopyContraction f g \u03b1 \u03b2, fun z \u21a6 ?_\u27e9\n erw [\u2190 closedHom_eq, closedHom_id]\n exact (coneHomotopyContraction_boundary f g \u03b1 \u03b2 h\u03b1' h\u03b2' z).symm\n exact ((dgClosedToHomotopy (C := CurvedDGRightModuleCat.{u, u, u} h) R).map_id\n (ForgetEnrichment.of (CochainComplex (ModuleCat R) \u2124) (cone f))).symm.trans hz\n\n/-- The strict inverse contraction is the zero-homotopy case of the corrected contraction. -/\n@[simp]\ntheorem coneHomotopyContraction_inv_zero [IsIso f] :\n coneHomotopyContraction f (inv f) 0 0 = coneContraction f := by\n apply Subtype.ext\n apply LinearMap.ext\n intro x\n simp [coneHomotopyContraction_apply, coneContraction_apply]\n\n", "statement": "/-- The strict contraction boundary follows from the general inverse-homotopy formula. -/\ntheorem coneContraction_boundary [IsIso f] (x : M \u00d7 N) :\n (cone f).differential ((coneContraction f).val x) +\n (coneContraction f).val ((cone f).differential x) = x ", "proof": " by\n simpa only [coneHomotopyContraction_inv_zero] using\n coneHomotopyContraction_boundary f (inv f) 0 0\n (fun z \u21a6 by\n simpa only [closedHom_comp, closedHom_id, LinearMap.comp_apply,\n LinearMap.id_apply, Submodule.coe_zero, LinearMap.zero_apply, map_zero,\n add_zero, sub_eq_zero] using\n congrArg (fun k \u21a6 closedHom k z) (IsIso.hom_inv_id f))\n (fun z \u21a6 by\n simpa only [closedHom_comp, closedHom_id, LinearMap.comp_apply,\n LinearMap.id_apply, Submodule.coe_zero, LinearMap.zero_apply, map_zero,\n add_zero, sub_eq_zero] using\n congrArg (fun k \u21a6 closedHom k z) (IsIso.inv_hom_id f)) x", "proof_lines": 12, "proof_length": 567, "rev": "75c8aed5fea63047615a25a9763fd5b68a86e891", "heartbeats": 6646, "image": "lean-compression:tauceti-75c8aed5fe-a608030cfc", "split": "dev"} {"path": "TauCeti/Combinatorics/DenseGraphLimits/ExchangeableGraphLaw/DissociatedRepresentation.lean", "module": "TauCeti.Combinatorics.DenseGraphLimits.ExchangeableGraphLaw.DissociatedRepresentation", "theorem": "TauCeti.DenseGraphLimits.ae_homDensityOnSpace_eq_upperMass_of_isDissociated", "prefix": "/-\nCopyright (c) 2026 The Tau Ceti contributors. All rights reserved.\nReleased under Apache 2.0 license as described in the file LICENSE.\nAuthors: The Tau Ceti contributors\n-/\nmodule\n\npublic import TauCeti.Combinatorics.DenseGraphLimits.ExchangeableGraphLaw.Existence\nimport Mathlib.Probability.Moments.Variance\nimport TauCeti.Combinatorics.DenseGraphLimits.Separation.Inverse\n\n/-!\n# Dissociated exchangeable graph laws are sampling laws\n\nA graphon mixture over an arbitrary probability carrier is dissociated exactly when its mixing\nmeasure is the Dirac mass at one graphon class (`isDissociated_mixtureExchangeableLaw_iff`). Hence a\ndissociated exchangeable graph law is the sampling law of a single graphon, which can be taken on\nany atomless standard Borel carrier, such as the unit interval (`exists_graphon_of_isDissociated`).\nTogether with `isDissociated_sampleExchangeableLaw` this identifies the dissociated exchangeable\ngraph laws with the sampling laws of graphons.\n\nThe route is through the homomorphism-density coordinates. Under any mixing measure of a\ndissociated law, every homomorphism density is almost surely equal to the corresponding upper mass\n(`ae_homDensityOnSpace_eq_upperMass_of_isDissociated`), so all homomorphism-density coordinates are\nalmost surely constant at once; since they separate graphon classes, almost every class is the same\none. The representing graphon is unique only up to cut distance zero.\n\n## Main results\n\n* `TauCeti.DenseGraphLimits.ae_homDensityOnSpace_eq_upperMass_of_isDissociated` \u2014 under a mixing\n measure of a dissociated law, `t(F, \u00b7)` is almost surely the upper mass of `F`.\n* `TauCeti.DenseGraphLimits.isDissociated_mixtureExchangeableLaw_iff` \u2014 a graphon mixture is\n dissociated exactly when its mixing measure is a Dirac mass.\n* `TauCeti.DenseGraphLimits.exists_graphon_of_isDissociated` \u2014 **every dissociated exchangeable\n graph law is the sampling law of a graphon on every atomless standard Borel carrier.**\n\n## References\n\n* P. Diaconis, S. Janson, *Graph limits and exchangeable random graphs*, Rend. Mat. Appl. (7) 28\n (2008), 33\u201361, Section 5.\n* L. Lov\u00e1sz, *Large Networks and Graph Limits*, AMS Colloquium Publications 60 (2012),\n Section 11.3.\n-/\n\npublic section\n\nnoncomputable section\n\nopen MeasureTheory ProbabilityTheory\n\nnamespace TauCeti\n\nnamespace DenseGraphLimits\n\nvariable {\u03a9 : Type*} [MeasurableSpace \u03a9] {\u03bc : Measure \u03a9} [IsProbabilityMeasure \u03bc]\n\n", "statement": "/-- Under a mixing measure of a dissociated exchangeable graph law, each homomorphism density is\nalmost surely constant, equal to the upper mass of the pattern. -/\ntheorem ae_homDensityOnSpace_eq_upperMass_of_isDissociated\n (P : ProbabilityMeasure (GraphonSpace \u03a9 \u03bc)) (h : (mixtureExchangeableLaw P).IsDissociated)\n {k : \u2115} (F : SimpleGraph (Fin k)) [DecidableRel F.Adj] :\n \u2200\u1d50 x \u2202(P : Measure (GraphonSpace \u03a9 \u03bc)),\n homDensityOnSpace F x = (mixtureExchangeableLaw P).upperMass F ", "proof": " by\n classical\n -- two disjoint copies of `F` have density `t(F, \u00b7)\u00b2`, so by dissociation the second moment of\n -- `t(F, \u00b7)` is the square of its mean, and its variance is zero\n have hsq : \u2200 x : GraphonSpace \u03a9 \u03bc,\n homDensityOnSpace ((F \u2295g F).map finSumFinEquiv.toEmbedding) x =\n homDensityOnSpace F x ^ 2 := fun x => by\n rw [homDensityOnSpace_map_embedding, homDensityOnSpace_sum, sq]\n have hmem : MemLp (homDensityOnSpace (\u03bc := \u03bc) F) 2 (P : Measure (GraphonSpace \u03a9 \u03bc)) :=\n MemLp.of_bound (continuous_homDensityOnSpace F).aestronglyMeasurable 1\n (ae_of_all _ fun x => by\n rw [Real.norm_of_nonneg (homDensityOnSpace_nonneg F x)]\n exact homDensityOnSpace_le_one F x)\n have hmul := (isDissociated_iff_upperMass_mul _).1 h k k F F\n rw [upperMass_mixtureExchangeableLaw, upperMass_mixtureExchangeableLaw] at hmul\n simp_rw [hsq] at hmul\n have hvar : Var[homDensityOnSpace (\u03bc := \u03bc) F; (P : Measure (GraphonSpace \u03a9 \u03bc))] = 0 := by\n rw [variance_eq_sub hmem]\n simp only [Pi.pow_apply]\n rw [hmul, sq, sub_self]\n filter_upwards [ae_eq_integral_of_variance_eq_zero hmem hvar] with x hx\n rw [hx, upperMass_mixtureExchangeableLaw]", "proof_lines": 21, "proof_length": 933, "rev": "75c8aed5fea63047615a25a9763fd5b68a86e891", "heartbeats": 703, "image": "lean-compression:tauceti-75c8aed5fe-a608030cfc", "split": "dev"} {"path": "TauCeti/NumberTheory/LocalField/WorkedExamples/DyadicSqrt/NormControl.lean", "module": "TauCeti.NumberTheory.LocalField.WorkedExamples.DyadicSqrt.NormControl", "theorem": "TauCeti.DyadicSqrtTwo.not_exists_integerRing_sq_sub_five_mul_sq_eq_one_add_sqrtTwo", "prefix": "/-\nCopyright (c) 2026 The Tau Ceti contributors. All rights reserved.\nReleased under Apache 2.0 license as described in the file LICENSE.\nAuthors: The Tau Ceti contributors\n-/\nmodule\n\npublic import TauCeti.NumberTheory.LocalField.WorkedExamples.DyadicSqrt.Two\npublic import TauCeti.NumberTheory.LocalField.Eisenstein.Quadratic\npublic import TauCeti.NumberTheory.LocalField.QuadraticForm.UnramifiedClass\n\n/-!\n# A unit norm over `\u211a\u2082(\u221a2)` without integral square-root coordinates\n\nPut `\u03c0 = \u221a2`. The unit `1 + \u03c0` is the norm of `(\u03c0 + 1/2) + (1/2)\u221a5`, but has no representation\n`x\u00b2 - 5y\u00b2` with both `x` and `y` integral. Consequently the two naive families\n`u\u00b2(1 - 5t\u00b2)` and `-5u\u00b2(1 - 5t\u00b2)` with integral `u,t` miss a unit norm. The obstruction is the\ncoefficient of `\u03c0` in the Eisenstein integral basis `(1, \u03c0)`: it is divisible by `2` in every\nsuch integral norm, whereas that coefficient in `1 + \u03c0` is `1`.\n\n## References\n\n* O. T. O'Meara, *Introduction to Quadratic Forms*, \u00a763A, for the unramified quadratic norm class.\n* J.-P. Serre, *Local Fields*, Chapter V, \u00a72, for norms in unramified extensions.\n\n-/\n\npublic section\nnoncomputable section\n\nopen ValuativeRel IsLocalRing\n\nnamespace TauCeti.DyadicSqrtTwo\n\n@[simp]\nprivate theorem coe_five_integerRing : ((5 : \ud835\udcaa[DyadicSqrtTwo]) : DyadicSqrtTwo) = 5 :=\n map_ofNat (Subring.subtype \ud835\udcaa[DyadicSqrtTwo]) 5\n\n/-- Over the ramified base `\u211a\u2082(\u221a2)`, radicand `5` is still the unramified quadratic\nclass: its norms are exactly the elements of even normalized valuation. -/\ntheorem exists_eq_sq_sub_five_mul_sq_iff_even_normalizedValuation (b : DyadicSqrtTwo\u02e3) :\n (\u2203 x y : DyadicSqrtTwo, (b : DyadicSqrtTwo) = x ^ 2 - 5 * y ^ 2) \u2194\n Even (normalizedValuation DyadicSqrtTwo b).toAdd := by\n let : Fintype \ud835\udcc0[DyadicSqrtTwo] := Fintype.ofFinite _\n have hcard : Fintype.card \ud835\udcc0[DyadicSqrtTwo] = 2 := by\n rw [\u2190 Nat.card_eq_fintype_card, natCard_residueField]\n have htwo : (2 : \ud835\udcc0[DyadicSqrtTwo]) = 0 := by\n simpa only [hcard, Nat.cast_ofNat] using FiniteField.cast_card_eq_zero \ud835\udcc0[DyadicSqrtTwo]\n have hc (t : \ud835\udcc0[DyadicSqrtTwo]) :\n t ^ 2 + t \u2260 residue \ud835\udcaa[DyadicSqrtTwo] 1 := by\n have ht : t ^ 2 = t := by simpa only [hcard] using FiniteField.pow_card t\n rw [ht, \u2190 two_mul, htwo, zero_mul, map_one]\n exact zero_ne_one\n have hrad : (1 : DyadicSqrtTwo) + 4 * ((1 : \ud835\udcaa[DyadicSqrtTwo]) : DyadicSqrtTwo) = 5 := by\n norm_num\n simpa only [hrad] using exists_eq_sq_sub_one_add_four_mul_mul_sq_iff_even\n (K := DyadicSqrtTwo) two_ne_zero hc b\n\n/-- The control norm is a unit of the integer ring of the ramified base. -/\ntheorem isUnit_one_add_integerSqrtTwo : IsUnit (1 + integerSqrtTwo) := by\n have hn : \u00ac IsUnit (-integerSqrtTwo) := by\n simpa using irreducible_integerSqrtTwo.not_isUnit\n simpa using (isUnit_or_isUnit_one_sub_self (-integerSqrtTwo)).resolve_left hn\n\n/-- Rational square-root coordinates exhibit the unit `1 + \u221a2` as a norm for radicand `5`. -/\ntheorem one_add_sqrtTwo_eq_sq_sub_five_mul_sq :\n 1 + sqrtTwo = (sqrtTwo + 1 / 2) ^ 2 - 5 * (1 / 2 : DyadicSqrtTwo) ^ 2 := by\n linear_combination -sqrtTwo_sq\n\n", "statement": "/-- The unit norm `1 + \u221a2` has no integral representation in the square-root basis for\nradicand `5`. The maximal order of that quadratic extension is essential. -/\ntheorem not_exists_integerRing_sq_sub_five_mul_sq_eq_one_add_sqrtTwo :\n \u00ac \u2203 x y : \ud835\udcaa[DyadicSqrtTwo], (x : DyadicSqrtTwo) ^ 2 - 5 * (y : DyadicSqrtTwo) ^ 2 =\n 1 + sqrtTwo ", "proof": " by\n obtain \u27e8B, hB0, hB1, -, -\u27e9 := exists_basis_integerRing_of_sq_eq_of_irreducible\n (K := \u211a_[2]) (L := DyadicSqrtTwo) (a := 2) (Padic.irreducible_natCast_self 2)\n (x := sqrtTwo) (by simpa only [_root_.Padic.coe_two_integerRing 2, map_ofNat] using sqrtTwo_sq)\n have hB1' : B 1 = integerSqrtTwo := Subtype.ext (hB1.trans coe_integerSqrtTwo.symm)\n have h\u03c0 : integerSqrtTwo ^ 2 = (2 : \ud835\udcaa[DyadicSqrtTwo]) := by\n apply Subtype.ext\n simpa only [SubmonoidClass.coe_pow, coe_integerSqrtTwo, coe_ofNat_two] using sqrtTwo_sq\n have hr (z : \ud835\udcaa[DyadicSqrtTwo]) :\n z = B.repr z 0 \u2022 (1 : \ud835\udcaa[DyadicSqrtTwo]) + B.repr z 1 \u2022 integerSqrtTwo := by\n simpa only [Fin.sum_univ_two, hB0, hB1'] using (B.sum_repr z).symm\n rintro \u27e8x, y, hxy\u27e9\n have h : x ^ 2 - 5 * y ^ 2 = 1 + integerSqrtTwo := by\n apply Subtype.ext\n simpa only [SubmonoidClass.coe_pow, AddSubgroupClass.coe_sub, Subring.coe_mul,\n Subring.coe_add, Subring.coe_one, coe_five_integerRing,\n coe_integerSqrtTwo] using hxy\n have hc :\n (B.repr x 0 ^ 2 + 2 * B.repr x 1 ^ 2 -\n 5 * (B.repr y 0 ^ 2 + 2 * B.repr y 1 ^ 2)) \u2022 B 0 +\n (2 * (B.repr x 0 * B.repr x 1 - 5 * B.repr y 0 * B.repr y 1)) \u2022 B 1 =\n 1 + integerSqrtTwo := by\n rw [hB0, hB1']\n calc\n _ = x ^ 2 - 5 * y ^ 2 := by\n conv_rhs => rw [hr x, hr y]\n simp only [Algebra.smul_def, map_sub, map_add, map_mul, map_pow, map_ofNat]\n linear_combination\n -(algebraMap \ud835\udcaa[\u211a_[2]] \ud835\udcaa[DyadicSqrtTwo] (B.repr x 1) ^ 2 -\n 5 * algebraMap \ud835\udcaa[\u211a_[2]] \ud835\udcaa[DyadicSqrtTwo] (B.repr y 1) ^ 2) * h\u03c0\n _ = _ := h\n rw [\u2190 hB0, \u2190 hB1'] at hc\n have hcoeff := congrArg (fun z => B.repr z 1) hc\n simp only [map_add, map_smul, Module.Basis.repr_self, Finsupp.add_apply,\n Finsupp.smul_apply, Finsupp.single_apply, smul_eq_mul, Fin.zero_ne_one,\n \u2193reduceIte, mul_zero, mul_one, zero_add] at hcoeff\n have h2 : Irreducible (2 : \ud835\udcaa[\u211a_[2]]) := by\n simpa using Padic.irreducible_natCast_self 2\n exact h2.not_isUnit (isUnit_of_dvd_one \u27e8_, hcoeff.symm\u27e9)", "proof_lines": 38, "proof_length": 1851, "rev": "75c8aed5fea63047615a25a9763fd5b68a86e891", "heartbeats": 10628, "image": "lean-compression:tauceti-75c8aed5fe-a608030cfc", "split": "dev"} {"path": "TauCeti/Algebra/AlgebraicGroup/Chevalley/Weyl/Root.lean", "module": "TauCeti.Algebra.AlgebraicGroup.Chevalley.Weyl.Root", "theorem": "TauCeti.DynkinType.ChevalleyDatum.weylElement_mem_weylSubgroup", "prefix": "/-\nCopyright (c) 2026 The Tau Ceti contributors. All rights reserved.\nReleased under Apache 2.0 license as described in the file LICENSE.\nAuthors: The Tau Ceti contributors\n-/\nmodule\n\npublic import TauCeti.Algebra.AlgebraicGroup.Chevalley.Weyl.Basic\nimport TauCeti.Algebra.AlgebraicGroup.Chevalley.Root.Weyl\nimport TauCeti.LinearAlgebra.RootSystem.Weyl.Orbit.Basic\n\n/-!\n# The root action of the Chevalley Weyl subgroup\n\nThe subgroup generated by the actual torus and the pinned simple Weyl representatives acts\non all root subgroups through its Weyl projection. More precisely, conjugation by any lift\nof a Weyl element carries each root parameter to a unit multiple of that parameter at the\nimage root. Thus the root subgroup, unlike its parametrization, is independent of the lift.\nThese formulas allow Weyl lifts to transport the root-generated subgroups used in Bruhat\ncells. They do not identify the kernel of the Weyl projection with the torus.\n\nBy simple-reflection induction and `ChevalleyDatum.weylElement_conj_weylElement`, the Weyl\nsubgroup also contains Steinberg's Weyl element `n_\u03b3(s)` for every root `\u03b3` and unit `s`\n(`ChevalleyDatum.weylElement_mem_weylSubgroup`), and over a field `n_\u03b3(s)` projects to\nthe reflection `s_\u03b3` in the Weyl group (`ChevalleyDatum.weylProjection_weylElement`).\nConsequently `D.weylSubgroup A` is also generated by the actual torus together with all root\nWeyl representatives (`ChevalleyDatum.weylSubgroup_eq_closure_weylElement_one`,\n`ChevalleyDatum.weylSubgroup_eq_closure_weylElement`).\n\nThe proof combines the existing pinning equation and the signed simple Weyl conjugation\nformula in `ChevalleyDatum.weylElement_conj_rootSubgroupPoints`. It works over finite fields\nas well as infinite ones; the Weyl projection already uses scalar extension to distinguish\ncharacters when the original field is finite.\n\n## References\n\n* R. Steinberg, *Lectures on Chevalley Groups*, Chapter 3, Lemmas 19 and 22.\n* R. W. Carter, *Simple Groups of Lie Type*, \u00a77.2.\n-/\n\npublic section\n\nnamespace TauCeti.DynkinType.ChevalleyDatum\n\nopen Multiplicative\n\nuniverse v\n\nvariable {t : DynkinType} {ht : t.Valid} (D : ChevalleyDatum t ht)\n\nsection Field\n\nvariable (K : Type v) [Field K]\n\nprivate def RescalesRoots (g : D.weylSubgroup K) : Prop :=\n \u2200 \u03b3 : Fin t.numRoots, \u2203 c : K\u02e3, \u2200 u : K,\n MulAut.conj (g : D.points K) (D.rootSubgroupPoints \u03b3 K (ofAdd u)) =\n D.rootSubgroupPoints\n ((t.simplyConnectedRootDatum ht).weylGroupToPerm (D.weylProjection K g) \u03b3) K\n (ofAdd ((c : K) * u))\n\nprivate theorem rescalesRoots_one : D.RescalesRoots K 1 := by\n intro \u03b3\n exact \u27e81, fun u => by simp\u27e9\n\nprivate theorem RescalesRoots.mul {g h : D.weylSubgroup K}\n (hg : D.RescalesRoots K g) (hh : D.RescalesRoots K h) :\n D.RescalesRoots K (g * h) := by\n intro \u03b3\n obtain \u27e8d, hd\u27e9 := hh \u03b3\n obtain \u27e8c, hc\u27e9 := hg\n ((t.simplyConnectedRootDatum ht).weylGroupToPerm (D.weylProjection K h) \u03b3)\n refine \u27e8c * d, fun u => ?_\u27e9\n simp only [Subgroup.coe_mul, map_mul, MulAut.mul_apply, Equiv.Perm.mul_apply,\n hd, hc, Units.val_mul, mul_assoc]\n\nprivate theorem RescalesRoots.inv {g : D.weylSubgroup K}\n (hg : D.RescalesRoots K g) : D.RescalesRoots K g\u207b\u00b9 := by\n intro \u03b3\n let w := (t.simplyConnectedRootDatum ht).weylGroupToPerm (D.weylProjection K g)\n obtain \u27e8c, hc\u27e9 := hg (w\u207b\u00b9 \u03b3)\n refine \u27e8c\u207b\u00b9, fun u => ?_\u27e9\n rw [Subgroup.coe_inv, map_inv, MulAut.inv_apply, map_inv, map_inv]\n apply (MulAut.conj (g : D.points K)).symm_apply_eq.mpr\n have hw : (t.simplyConnectedRootDatum ht).weylGroupToPerm\n (D.weylProjection K g) (w\u207b\u00b9 \u03b3) = \u03b3 := w.apply_symm_apply \u03b3\n simpa only [hw, \u2190 mul_assoc, Units.val_inv_eq_inv_val,\n mul_inv_cancel\u2080 (Units.ne_zero c), one_mul] using\n (hc (((c\u207b\u00b9 : K\u02e3) : K) * u)).symm\n\n/-- Every Weyl lift acts on a root subgroup by a unit rescaling of its additive parameter.\nThe target root is specified by the existing Weyl projection, not by a choice of word. -/\ntheorem exists_unit_conj_rootSubgroupPoints (g : D.weylSubgroup K) (\u03b3 : Fin t.numRoots) :\n \u2203 c : K\u02e3, \u2200 u : K,\n MulAut.conj (g : D.points K) (D.rootSubgroupPoints \u03b3 K (ofAdd u)) =\n D.rootSubgroupPoints\n ((t.simplyConnectedRootDatum ht).weylGroupToPerm (D.weylProjection K g) \u03b3) K\n (ofAdd ((c : K) * u)) := by\n let H : Subgroup (D.weylSubgroup K) :=\n { carrier := {g | D.RescalesRoots K g}\n one_mem' := D.rescalesRoots_one K\n mul_mem' := RescalesRoots.mul D K\n inv_mem' := RescalesRoots.inv D K }\n have hle : D.weylSubgroup K \u2264 H.map (D.weylSubgroup K).subtype := by\n apply (D.weylSubgroup_def K).le.trans\n apply (Subgroup.closure_le _).mpr\n rintro _ (\u27e8s, rfl\u27e9 | \u27e8i, rfl\u27e9)\n \u00b7 refine \u27e8\u27e8_, D.torusPoints_mem_weylSubgroup K s\u27e9, ?_, rfl\u27e9\n intro \u03b4\n refine \u27e8torusCharacter s (D.coordinateRoot \u03b4), fun u => ?_\u27e9\n simp only [D.weylProjection_torusPoints, map_one, Equiv.Perm.one_apply]\n exact D.torusPoints_conj_rootSubgroupPoints \u03b4 K s u\n \u00b7 refine \u27e8D.simpleWeylLift K i, ?_, D.coe_simpleWeylLift K i\u27e9\n intro \u03b4\n refine \u27e8Units.map (Int.castRingHom K).toMonoidHom\n (t.chevalleyWeylSign ht (t.simpleIndex ht i) \u03b4), fun u => ?_\u27e9\n simp only [D.weylProjection_simpleWeylLift,\n RootPairing.weylGroupToPerm_ofIdx_apply, Units.coe_map,\n MulAut.conj_apply, D.coe_simpleWeylLift]\n exact D.weylElement_conj_rootSubgroupPoints i \u03b4 K u\n obtain \u27e8h, hh, heq\u27e9 := hle g.property\n have heq' : h = g := Subtype.ext heq\n subst h\n exact hh \u03b3\n\n/-- Conjugation by a Weyl lift transports a root subgroup to the root subgroup at the\nprojected root. The parameter scaling disappears on taking ranges. -/\ntheorem map_range_rootSubgroupPoints_conj (g : D.weylSubgroup K) (\u03b3 : Fin t.numRoots) :\n (D.rootSubgroupPoints \u03b3 K).range.map (MulAut.conj (g : D.points K)).toMonoidHom =\n (D.rootSubgroupPoints\n ((t.simplyConnectedRootDatum ht).weylGroupToPerm (D.weylProjection K g) \u03b3) K).range := by\n obtain \u27e8c, hc\u27e9 := D.exists_unit_conj_rootSubgroupPoints K g \u03b3\n apply le_antisymm\n \u00b7 rintro _ \u27e8_, \u27e8u, rfl\u27e9, rfl\u27e9\n refine \u27e8ofAdd ((c : K) * toAdd u), ?_\u27e9\n simpa [MulAut.conj_apply] using (hc (toAdd u)).symm\n \u00b7 rintro _ \u27e8u, rfl\u27e9\n refine \u27e8D.rootSubgroupPoints \u03b3 K (ofAdd (((c\u207b\u00b9 : K\u02e3) : K) * toAdd u)),\n \u27e8_, rfl\u27e9, ?_\u27e9\n simp [hc]\n\n/-- Conjugating a root subgroup element `x \u2208 X_\u03b3(K)` by a Weyl lift `g` lands in the root\nsubgroup at the projected root `w(\u03b3)`. -/\n@[grind \u2190]\ntheorem conj_mem_range_rootSubgroupPoints (g : D.weylSubgroup K) {\u03b3 : Fin t.numRoots}\n {x : D.points K} (hx : x \u2208 (D.rootSubgroupPoints \u03b3 K).range) :\n MulAut.conj (g : D.points K) x \u2208\n (D.rootSubgroupPoints\n ((t.simplyConnectedRootDatum ht).weylGroupToPerm (D.weylProjection K g) \u03b3) K).range := by\n rw [\u2190 D.map_range_rootSubgroupPoints_conj K g \u03b3]\n exact Subgroup.mem_map_of_mem _ hx\n\n/-- A Weyl lift transports the subgroup generated by any set of root subgroups to the\nsubgroup generated by the image root set. No closure condition on the root set is required. -/\ntheorem map_iSup_rootSubgroupPoints_conj (g : D.weylSubgroup K)\n (S : Set (Fin t.numRoots)) :\n (\u2a06 \u03b3 \u2208 S, (D.rootSubgroupPoints \u03b3 K).range).map\n (MulAut.conj (g : D.points K)).toMonoidHom =\n \u2a06 \u03b3 \u2208 (t.simplyConnectedRootDatum ht).weylGroupToPerm (D.weylProjection K g) '' S,\n (D.rootSubgroupPoints \u03b3 K).range := by\n simp only [Subgroup.map_iSup, D.map_range_rootSubgroupPoints_conj, iSup_image]\n\nend Field\n\nprivate theorem weylElement_reflectionPerm_eq_conj (i : Fin t.rank) (\u03b3 : Fin t.numRoots)\n (A : Type v) [CommRing A] (s : A\u02e3) :\n D.weylElement ((t.simplyConnectedRootDatum ht).reflectionPerm (t.simpleIndex ht i) \u03b3) A s =\n D.weylElement (t.simpleIndex ht i) A 1 *\n D.weylElement \u03b3 A ((Units.map (Int.castRingHom A).toMonoidHom\n (t.chevalleyWeylSign ht (t.simpleIndex ht i) \u03b3))\u207b\u00b9 * s) *\n (D.weylElement (t.simpleIndex ht i) A 1)\u207b\u00b9 := by\n have hconj := D.weylElement_conj_weylElement i \u03b3 A\n ((Units.map (Int.castRingHom A).toMonoidHom\n (t.chevalleyWeylSign ht (t.simpleIndex ht i) \u03b3))\u207b\u00b9 * s)\n rw [mul_inv_cancel_left] at hconj\n exact hconj.symm\n\n", "statement": "/-- **Steinberg's Weyl element `n_\u03b3(s)` lies in `D.weylSubgroup A` for every root `\u03b3` and unit\n`s`**, over every commutative ring `A`. -/\n@[simp]\ntheorem weylElement_mem_weylSubgroup (\u03b3 : Fin t.numRoots) (A : Type v) [CommRing A]\n (s : A\u02e3) : D.weylElement \u03b3 A s \u2208 D.weylSubgroup A ", "proof": " by\n revert s\n refine (t.rationalBase ht).induction_simple_reflect \u03b3\n (p := fun k => \u2200 s : A\u02e3, D.weylElement k A s \u2208 D.weylSubgroup A)\n (fun k hk s => ?_) (fun k j hk hj s => ?_)\n \u00b7 obtain \u27e8i, rfl\u27e9 := exists_simpleIndex_eq_of_mem_support hk\n rw [D.weylElement_simpleIndex_eq_torusPoints_mul]\n exact Subgroup.mul_mem _ (D.torusPoints_mem_weylSubgroup A _)\n (D.weylElement_simpleIndex_one_mem_weylSubgroup A i)\n \u00b7 obtain \u27e8i, rfl\u27e9 := exists_simpleIndex_eq_of_mem_support hj\n rw [t.reflectionPerm_rationalRootSystem ht, D.weylElement_reflectionPerm_eq_conj]\n exact Subgroup.mul_mem _\n (Subgroup.mul_mem _ (D.weylElement_simpleIndex_one_mem_weylSubgroup A i) (hk _))\n (Subgroup.inv_mem _ (D.weylElement_simpleIndex_one_mem_weylSubgroup A i))", "proof_lines": 13, "proof_length": 722, "rev": "75c8aed5fea63047615a25a9763fd5b68a86e891", "heartbeats": 493, "image": "lean-compression:tauceti-75c8aed5fe-a608030cfc", "split": "dev"} {"path": "TauCeti/Algebra/Lie/E6/DoubledMinuscule/TorusCentralizer/Scheme.lean", "module": "TauCeti.Algebra.Lie.E6.DoubledMinuscule.TorusCentralizer.Scheme", "theorem": "TauCeti.E6DoubledMinuscule.centralizerHopfIdeal_weightTorus_toIdeal_eq_ker", "prefix": "/-\nCopyright (c) 2026 The Tau Ceti contributors. All rights reserved.\nReleased under Apache 2.0 license as described in the file LICENSE.\nAuthors: The Tau Ceti contributors\n-/\nmodule\n\npublic import TauCeti.Algebra.Lie.E6.DoubledMinuscule.MaximalTorus\npublic import TauCeti.Algebra.Lie.E6.DoubledMinuscule.StandardComodule\npublic import TauCeti.Algebra.AlgebraicGroup.DiagonalizableGroup.Centralizer.Functorial\npublic import TauCeti.Algebra.AlgebraicGroup.GeneralLinear.Weight.Centralizer\nimport TauCeti.Algebra.Lie.E6.DoubledMinuscule.PointsFunctor\n\n/-!\n# Schematic self-centralization of the doubled E\u2086 weight torus\n\nThe rank-six weight torus of the integral doubled minuscule carrier is its own schematic\ncentralizer, after specialization to any commutative base ring. The point statement tests every\ncommutative value algebra, not just rational points over infinite fields. Equality of the defining\nideals therefore includes infinitesimal structure, even in characteristics two and three.\n\nDistinct weight characters force a centralizing matrix to be diagonal. The all-ring diagonal\ncriterion of `TauCeti.E6DoubledMinuscule.mem_range_weightTorusPoints_iff_isDiag`, obtained from the\ninvariant cross product, then recovers its torus parameter. This supplies schematic torus\nrecognition for the explicit carrier, not an identification with the pinned simply connected\ngroup scheme of type E\u2086. Constructions transfer to that pinned group only along such an\nidentification once proved. No equality with the separately ground-ring-generated carrier is\nasserted.\n\n## Main results\n\n* `centralizerPointsSubgroup_eq_range_weightTorus`: the centralizer is the torus on all value\n algebras, including finite and nonreduced ones.\n* `centralizerHopfIdeal_weightTorus_toIdeal_eq_ker`: the centralizer's defining ideal is the\n kernel of restriction to the weight torus.\n\n## References\n\n* J. E. Humphreys, *Linear Algebraic Groups*, \u00a7\u00a716 and 26.\n* J. S. Milne, *Algebraic Groups* (2017), Chapters 3 and 17.\n* The schematic diagonalization uses the method of\n `TauCeti.Algebra.Lie.E7.Minuscule.Generated.TorusCentralizer`; the diagonal-intersection\n calculation is the doubled carrier's existing invariant-cross-product construction.\n-/\n\npublic section\n\nopen CategoryTheory WithConv\n\nnamespace TauCeti.E6DoubledMinuscule\n\nuniverse u v\n\nvariable (R : Type u) [CommRing R]\n\nprivate theorem torus_comp_coordinateMap :\n (weightTorusToBaseChangeCoordinateMap R).hom.comp (coordinateMap R).hom =\n GeneralLinear.weightTorusCoordinateBialgHom (S := R) matrixWeight := by\n rw [\u2190 CommHopfAlgCat.hom_comp, coordinateMap_comp_weightTorusToBaseChangeCoordinateMap,\n GeneralLinear.hom_weightTorusBaseChangeCoordinateMap]\n\nprivate theorem centralizer_iff_isDiag (A : CommAlgCat.{v} R)\n (g : HopfAlgebra.points (R := R) (H := coordinateHopfAlgebra R) A) :\n g \u2208 BialgHom.centralizerPointsSubgroup (weightTorusToBaseChangeCoordinateMap R).hom A \u2194\n (GeneralLinear.pointsMulEquiv 54 (BialgHom.mapDomain (coordinateMap R).hom g) :\n Matrix (Fin 54) (Fin 54) A).IsDiag := by\n have hwt : Function.Injective matrixWeight := by\n intro a b h\n apply minusculeCharacter_injective\n exact congrArg SplitTorus.weightCharacter h\n have h := BialgHom.centralizerHopfIdeal_comp_le_ker_iff\n (coordinateMap R).hom (coordinateMap_surjective R)\n (weightTorusToBaseChangeCoordinateMap R).hom g\n rw [torus_comp_coordinateMap,\n GeneralLinear.centralizerHopfIdeal_weightTorus_le_ker_iff_isDiag _ hwt] at h\n rw [BialgHom.centralizerPointsSubgroup, CommHopfAlgCat.mem_quotientPointsSubgroup_iff]\n simpa only [IsConcreteLE.le_iff, RingHom.mem_ker, HopfIdeal.mem_toIdeal] using h.symm\n\n-- The matrix formula uses the direct bialgebra presentation, allowing independent universes\n-- for the coefficient ring, value algebra and finite weight indices.\nprivate theorem torus_matrix (A : CommAlgCat.{v} R)\n (q : HopfAlgebra.points (R := R)\n (H := (DiagonalizableGroup.coordinateRing R\n (SplitTorus.characterGroup (Fin 6))).obj) A) :\n GeneralLinear.pointsMulEquiv 54\n (BialgHom.mapDomain (coordinateMap R).hom\n (BialgHom.mapDomain (weightTorusToBaseChangeCoordinateMap R).hom q)) =\n (weightTorusPoints A (SplitTorus.pointsMulEquiv q) :\n Matrix.GeneralLinearGroup (Fin 54) A) := by\n have he : BialgHom.mapDomain (coordinateMap R).hom\n (BialgHom.mapDomain (weightTorusToBaseChangeCoordinateMap R).hom q) =\n BialgHom.mapDomain\n ((weightTorusToBaseChangeCoordinateMap R).hom.comp (coordinateMap R).hom) q := by\n simp only [BialgHom.mapDomain_apply, BialgHom.comp_toAlgHom, AlgHom.comp_assoc]\n rw [he, torus_comp_coordinateMap]\n apply Units.ext\n rw [coe_weightTorusPoints, UniversalEnvelopingAlgebra.kostantTorusMatrix_apply, diagGL_coe,\n GeneralLinear.pointsMulEquiv_apply, BialgHom.mapDomain_apply,\n GeneralLinear.weightTorusCoordinateBialgHom_def,\n DiagonalizableGroup.pointToGeneralLinear_comp_diagonalCoordinateMap]\n congr 1\n funext i\n exact congrArg (fun s : A\u02e3 \u21a6 (s : A))\n (SplitTorus.charOfPoint_weightCharacter q (matrixWeight i))\n\n/-- Over every value algebra, the schematic centralizer of the doubled E\u2086 weight torus is\nexactly the image of that torus. This tests extensions of the value algebra, rather than only\ncommutation with its rational torus points. -/\ntheorem centralizerPointsSubgroup_eq_range_weightTorus (A : CommAlgCat.{v} R) :\n BialgHom.centralizerPointsSubgroup (weightTorusToBaseChangeCoordinateMap R).hom A =\n (BialgHom.mapDomain (weightTorusToBaseChangeCoordinateMap R).hom).range := by\n ext g\n rw [centralizer_iff_isDiag, MonoidHom.mem_range]\n constructor\n \u00b7 intro hg\n let p := (pointsPresentation A).mulEquiv\n (CommHopfAlgCat.baseChangeIsoPointsMulEquiv (baseChangeCoordinateIso R) A g)\n have hp : (p : Matrix.GeneralLinearGroup (Fin 54) A) =\n GeneralLinear.pointsMulEquiv 54 (BialgHom.mapDomain (coordinateMap R).hom g) := by\n rw [GeneralLinear.IntegralPointsPresentation.coe_mulEquiv_apply,\n BialgHom.mapDomain_apply, \u2190 CommHopfAlgCat.Hom.mapPointsFunctor_app_apply,\n mapPointsFunctor_coordinateMap_app]\n exact GeneralLinear.pointsMulEquiv_quotientPointsHom_baseChangeIsoPointsMulEquiv\n 54 definingIdeal (baseChangeDefiningIdeal R) (baseChangeCoordinateIso R)\n (mkQuotient_comp_baseChangeCoordinateIso_hom R) A g\n have hpdiag : ((p : Matrix.GeneralLinearGroup (Fin 54) A) :\n Matrix (Fin 54) (Fin 54) A).IsDiag := by\n rw [hp]\n exact hg\n obtain \u27e8s, hs\u27e9 := (mem_range_weightTorusPoints_iff_isDiag p).mpr hpdiag\n refine \u27e8(SplitTorus.pointsMulEquiv (R := R) (A := A)).symm s, ?_\u27e9\n apply BialgHom.mapDomain_injective_of_surjective _ (coordinateMap_surjective R)\n apply (GeneralLinear.pointsMulEquiv 54).injective\n rw [torus_matrix, MulEquiv.apply_symm_apply, \u2190 hp]\n exact congrArg Subtype.val hs\n \u00b7 rintro \u27e8q, rfl\u27e9\n rw [torus_matrix, coe_weightTorusPoints, UniversalEnvelopingAlgebra.kostantTorusMatrix_apply,\n diagGL_coe]\n exact Matrix.isDiag_diagonal _\n\n", "statement": "/-- The schematic centralizer of the doubled E\u2086 weight torus is cut out by the kernel of\nrestriction to the torus. This is equality of ideals, not merely equality of geometric points;\nno reducedness, flatness or field hypothesis is required. -/\ntheorem centralizerHopfIdeal_weightTorus_toIdeal_eq_ker :\n (BialgHom.centralizerHopfIdeal (weightTorusToBaseChangeCoordinateMap R).hom).toIdeal =\n RingHom.ker (weightTorusToBaseChangeCoordinateMap R).hom ", "proof": " by\n let \u03c0 := (weightTorusToBaseChangeCoordinateMap R).hom\n let I := BialgHom.centralizerHopfIdeal \u03c0\n apply le_antisymm\n \u00b7 have hmem : toConv \u03c0.toAlgHom \u2208 BialgHom.centralizerPointsSubgroup \u03c0\n (CommAlgCat.of R (DiagonalizableGroup.coordinateRing R\n (SplitTorus.characterGroup (Fin 6))).obj) := by\n rw [centralizerPointsSubgroup_eq_range_weightTorus]\n refine \u27e8toConv (AlgHom.id R _), ?_\u27e9\n simp only [BialgHom.mapDomain_apply, AlgHom.id_comp, \u03c0]\n exact (CommHopfAlgCat.mem_quotientPointsSubgroup_iff _ _ _ _).mp hmem\n -- Test the universal centralizer point to recover the actual ideal, not just its radical.\n \u00b7 let A := CommAlgCat.of R (CommHopfAlgCat.quotient (coordinateHopfAlgebra R) I)\n let g := CommHopfAlgCat.quotientPointsHom (coordinateHopfAlgebra R) I A\n (toConv (AlgHom.id R _))\n have hg : g \u2208 BialgHom.centralizerPointsSubgroup \u03c0 A :=\n CommHopfAlgCat.quotientPointsHom_mem_quotientPointsSubgroup _ I A _\n rw [centralizerPointsSubgroup_eq_range_weightTorus] at hg\n obtain \u27e8q, hq\u27e9 := hg\n intro x hx\n have hz : g.ofConv x = 0 := by\n rw [\u2190 hq, BialgHom.mapDomain_apply]\n exact (congrArg q.ofConv hx).trans (map_zero _)\n dsimp [A] at hz\n have hz' : (CommHopfAlgCat.mkQuotient (coordinateHopfAlgebra R) I).hom x = 0 := by\n simpa only [g, CommHopfAlgCat.quotientPointsHom_apply,\n ofConv_toConv, AlgHom.comp_apply, AlgHom.id_apply, BialgHom.coe_toAlgHom] using hz\n rw [CommHopfAlgCat.mkQuotient_apply, Ideal.Quotient.mk\u2090_eq_mk] at hz'\n exact Ideal.Quotient.eq_zero_iff_mem.mp hz'", "proof_lines": 28, "proof_length": 1361, "rev": "75c8aed5fea63047615a25a9763fd5b68a86e891", "heartbeats": 3195, "image": "lean-compression:tauceti-75c8aed5fe-a608030cfc", "split": "dev"} {"path": "TauCeti/RingTheory/RegularLocalRing/Locus.lean", "module": "TauCeti.RingTheory.RegularLocalRing.Locus", "theorem": "TauCeti.Excellence.regularLocus_trivSqZeroExt_eq_empty", "prefix": "/-\nCopyright (c) 2026 Taylor Dupuy, Thomas Tucker, Zhuoran Wang. All rights reserved.\nReleased under Apache 2.0 license as described in the file LICENSE.\nAuthors: Taylor Dupuy, Thomas Tucker, Zhuoran Wang\n-/\nmodule\n\npublic import Mathlib.Algebra.TrivSqZeroExt.Basic\npublic import Mathlib.RingTheory.RegularLocalRing.Defs\npublic import Mathlib.RingTheory.Spectrum.Prime.Basic\npublic import TauCeti.RingTheory.RegularLocalRing.Basic\n\n/-!\n# The regular locus of a commutative ring\n\nThe *regular locus* of a commutative ring `R` is the set of primes `p` of `R` whose localization\n`R_p` is a regular local ring (Stacks, Section 15.48, opening paragraph). It is defined for every\ncommutative ring, with no Noetherian hypothesis, and it need not be open: openness for all\nfinite type algebras is the J-2 condition of Stacks, Definition 15.48.1 (07P7).\n\n## Main definitions and results\n\n* `TauCeti.Excellence.regularLocus R`: the primes `p` of `R` with `R_p` a regular local ring.\n* `TauCeti.Excellence.mem_regularLocus_iff_of_isLocalization`: membership can be tested on any\n localization of `R` at the prime, not only on `Localization.AtPrime`.\n* `TauCeti.Excellence.regularLocus_eq_univ`: a regular ring is regular at every prime, and\n `TauCeti.Excellence.regularLocus_eq_univ_iff`: conversely, a Noetherian ring regular at every\n prime is a regular ring.\n* `TauCeti.Excellence.algebraMap_eq_zero_of_mem_regularLocus_of_isNilpotent`: a nilpotent element\n of `R` vanishes in every localization at a prime of the regular locus.\n* `TauCeti.Excellence.regularLocus_ringEquiv`: a ring isomorphism `R \u2243+* S` identifies the regular\n loci through the induced homeomorphism of prime spectra.\n* `Submonoid.preimage_comap_regularLocus`: the regular locus of a localization of `R` is the\n preimage of the regular locus of `R`.\n* `TauCeti.Excellence.regularLocus_eq_empty_of_subsingleton`: the zero ring has empty regular\n locus, as its spectrum is empty.\n* `TauCeti.Excellence.regularLocus_trivSqZeroExt_eq_empty`: the dual numbers `k[\u03b5]/(\u03b5\u00b2)` over a\n commutative ring `k` have empty regular locus, since a regular local ring is a domain.\n\n## References\n\n* [Stacks Project, Section 15.48](https://stacks.math.columbia.edu/tag/07P6).\n* Ported from T. Dupuy, T. Tucker and Z. Wang,\n [pcfawd-formalization](https://github.com/tdupu/pcfawd-formalization) at commit\n `a39c3781b9850b9f3d5cbc9920322a3b8e365ef2` (Apache-2.0),\n `lean/Pcf/Bounding/FiniteTypeRegularLocus.lean`: `regularLocus` and `regularLocus_eq_univ` are\n its `Pcf.primeRegularLocus` and `Pcf.primeRegularLocus_eq_univ`, and `regularLocus_ringEquiv`\n follows the comap-preimage form of its `Pcf.preimage_primeRegularLocus_of_isLocalization`\n together with its `Pcf.isRegularLocalRing_iff_of_ringEquiv`;\n `Submonoid.preimage_comap_regularLocus` is the comap-preimage form of\n `Pcf.preimage_primeRegularLocus_of_isLocalization` for an arbitrary localization. New here, with\n no source in that project: `mem_regularLocus_iff_of_isLocalization`, `regularLocus_eq_univ_iff`,\n `algebraMap_eq_zero_of_mem_regularLocus_of_isNilpotent`, the empty-locus results and the\n examples.\n-/\n\npublic section\n\nnamespace TauCeti.Excellence\n\nvariable (R : Type*) [CommRing R]\n\n/-- The *regular locus* of `R`: the primes `p` such that `R_p` is a regular local ring. It need not\nbe open. Stacks, Section 15.48. -/\ndef regularLocus : Set (PrimeSpectrum R) :=\n {p | IsRegularLocalRing (Localization.AtPrime p.asIdeal)}\n\nvariable {R}\n\n@[simp]\ntheorem mem_regularLocus {p : PrimeSpectrum R} :\n p \u2208 regularLocus R \u2194 IsRegularLocalRing (Localization.AtPrime p.asIdeal) :=\n Iff.rfl\n\n/-- A prime `p` lies in the regular locus exactly when some, equivalently every, localization `S`\nof `R` at `p` is a regular local ring. -/\ntheorem mem_regularLocus_iff_of_isLocalization {p : PrimeSpectrum R} (S : Type*) [CommRing S]\n [Algebra R S] [IsLocalization.AtPrime S p.asIdeal] :\n p \u2208 regularLocus R \u2194 IsRegularLocalRing S := by\n let e : Localization.AtPrime p.asIdeal \u2243+* S :=\n (IsLocalization.algEquiv p.asIdeal.primeCompl _ S).toRingEquiv\n rw [mem_regularLocus]\n exact \u27e8fun _ \u21a6 .of_ringEquiv e, fun _ \u21a6 .of_ringEquiv e.symm\u27e9\n\nvariable (R) in\n/-- Every prime of a regular ring lies in its regular locus. -/\ntheorem regularLocus_eq_univ [IsRegularRing R] : regularLocus R = Set.univ :=\n Set.eq_univ_of_forall fun _ \u21a6 mem_regularLocus.mpr inferInstance\n\nvariable (R) in\n/-- A Noetherian ring is a regular ring exactly when its regular locus is everything. -/\ntheorem regularLocus_eq_univ_iff [IsNoetherianRing R] :\n regularLocus R = Set.univ \u2194 IsRegularRing R :=\n \u27e8fun h \u21a6 isRegularRing_iff.mpr fun q hq \u21a6\n mem_regularLocus.mp (Set.eq_univ_iff_forall.mp h \u27e8q, hq\u27e9), fun _ \u21a6 regularLocus_eq_univ R\u27e9\n\n/-- A ring isomorphism `e : R \u2243+* S` identifies the regular loci: a prime `p` of `S` is in the\nregular locus of `S` exactly when its contraction to `R` is in the regular locus of `R`. -/\ntheorem regularLocus_ringEquiv {S : Type*} [CommRing S] (e : R \u2243+* S) :\n PrimeSpectrum.comap (e : R \u2192+* S) \u207b\u00b9' regularLocus R = regularLocus S := by\n ext p\n -- The prime of `R` below `p` is `p.asIdeal.comap e` by `PrimeSpectrum.comap_asIdeal`, a `rfl`\n -- lemma, so `e.map_primeCompl_comap_eq` applies to its complement as stated.\n let q := PrimeSpectrum.comap (e : R \u2192+* S) p\n let f : Localization.AtPrime q.asIdeal \u2243+* Localization.AtPrime p.asIdeal :=\n IsLocalization.ringEquivOfRingEquiv (M := q.asIdeal.primeCompl) _ _ e\n (e.map_primeCompl_comap_eq p.asIdeal)\n rw [Set.mem_preimage, mem_regularLocus, mem_regularLocus]\n exact \u27e8fun _ \u21a6 .of_ringEquiv f, fun _ \u21a6 .of_ringEquiv f.symm\u27e9\n\n/-- The regular locus of a localization `S` of `R` is the preimage of the regular locus of `R`:\nthe local ring of `S` at a prime `p` is the local ring of `R` at the contraction of `p`. -/\ntheorem _root_.Submonoid.preimage_comap_regularLocus {S : Type*} [CommRing S] [Algebra R S]\n (M : Submonoid R) [IsLocalization M S] :\n PrimeSpectrum.comap (algebraMap R S) \u207b\u00b9' regularLocus R = regularLocus S := by\n ext p\n have : IsLocalization.AtPrime (Localization.AtPrime p.asIdeal)\n (PrimeSpectrum.comap (algebraMap R S) p).asIdeal := by\n simp only [PrimeSpectrum.comap_asIdeal]\n exact IsLocalization.isLocalization_isLocalization_atPrime_isLocalization M _ p.asIdeal\n rw [Set.mem_preimage, mem_regularLocus (p := p)]\n exact mem_regularLocus_iff_of_isLocalization _\n\n/-- A nilpotent element of `R` vanishes in every localization `S` of `R` at a prime of the regular\nlocus, since a regular local ring is a domain. -/\ntheorem algebraMap_eq_zero_of_mem_regularLocus_of_isNilpotent {p : PrimeSpectrum R}\n (hp : p \u2208 regularLocus R) (S : Type*) [CommRing S] [Algebra R S]\n [IsLocalization.AtPrime S p.asIdeal] {a : R} (ha : IsNilpotent a) : algebraMap R S a = 0 :=\n have := (mem_regularLocus_iff_of_isLocalization S).mp hp\n (ha.map _).eq_zero\n\nvariable (R) in\n/-- The zero ring has empty regular locus, as it has no primes. -/\ntheorem regularLocus_eq_empty_of_subsingleton [Subsingleton R] : regularLocus R = \u2205 :=\n Set.eq_empty_of_isEmpty _\n\nvariable (k : Type*) [CommRing k]\n\n", "statement": "/-- The dual numbers `k[\u03b5]/(\u03b5\u00b2)` over a commutative ring `k` have empty regular locus: in every\nlocalization at a prime, `\u03b5` is a nonzero element with `\u03b5\u00b2 = 0`, whereas nilpotents vanish in the\nlocalizations at primes of the regular locus. -/\ntheorem regularLocus_trivSqZeroExt_eq_empty : regularLocus (TrivSqZeroExt k k) = \u2205 ", "proof": " by\n refine Set.eq_empty_of_forall_notMem fun p hp \u21a6 ?_\n set \u03b5 : TrivSqZeroExt k k := TrivSqZeroExt.inr 1\n have h\u03b5sq : \u03b5 * \u03b5 = 0 := by simp [\u03b5]\n have h\u03b5 := algebraMap_eq_zero_of_mem_regularLocus_of_isNilpotent hp\n (Localization.AtPrime p.asIdeal) (a := \u03b5) \u27e82, by rw [pow_two, h\u03b5sq]\u27e9\n -- Some `s \u2209 p` kills `\u03b5`; comparing second components forces `s.fst = 0`, so `s ^ 2 = 0 \u2208 p`.\n obtain \u27e8\u27e8s, hs\u27e9, hs\u03b5\u27e9 := (IsLocalization.map_eq_zero_iff p.asIdeal.primeCompl _ \u03b5).mp h\u03b5\n have hfst : s.fst = 0 := by\n simpa [\u03b5] using congrArg TrivSqZeroExt.snd hs\u03b5\n have hss : s * s = 0 := by\n ext <;> simp [hfst]\n exact hs (p.isPrime.mem_of_pow_mem 2 (by simp [pow_two, hss]))", "proof_lines": 12, "proof_length": 550, "rev": "75c8aed5fea63047615a25a9763fd5b68a86e891", "heartbeats": 1958, "image": "lean-compression:tauceti-75c8aed5fe-a608030cfc", "split": "dev"} {"path": "TauCeti/AlgebraicGeometry/FiniteEtale/AffineFiber.lean", "module": "TauCeti.AlgebraicGeometry.FiniteEtale.AffineFiber", "theorem": "TauCeti.FiniteEtaleScheme.algSpec_map_specCompFiberIso_hom_app", "prefix": "/-\nCopyright (c) 2026 The Tau Ceti contributors. All rights reserved.\nReleased under Apache 2.0 license as described in the file LICENSE.\nAuthors: The Tau Ceti contributors\n-/\nmodule\n\npublic import TauCeti.AlgebraicGeometry.FiniteEtale.Fiber\npublic import TauCeti.AlgebraicGeometry.Scheme.SpecOver\n\n/-!\n# Geometric fibres of spectra of finite \u00e9tale algebras\n\nLet `R` be a commutative ring and `\u03a9` a separably closed field which is an `R`-algebra, so that\n`x : Spec \u03a9 \u27f6 Spec R` is a geometric point of `Spec R`. For a finite \u00e9tale `R`-algebra `A`, the\ngeometric fibre of `Spec A \u27f6 Spec R` at `x` is the finite set `A \u2192\u2090[R] \u03a9` of `\u03a9`-valued points\nof `A`, naturally in `A`: a point of the fibre is a lift of `x` to `Spec A`, and such lifts are\nspectra of `R`-algebra maps `A \u2192 \u03a9`. In other words, the composite of the spectrum functor\n`TauCeti.FiniteEtaleScheme.spec R` with the geometric fibre functor at `x` is Mathlib's fibre\nfunctor `CommAlgCat.FiniteEtale.fiber R \u03a9` on finite \u00e9tale algebras\n(`TauCeti.FiniteEtaleScheme.specCompFiberIso`).\n\nThis computes geometric fibres, and hence actions of \u00e9tale fundamental groups, on finite \u00e9tale\ncovers given by explicit algebras over an affine base, without passing through the\nclassification of finite \u00e9tale schemes over `Spec \u03a9`.\n\n## Main definitions\n\n* `TauCeti.FiniteEtaleScheme.algSpecCompCoyonedaIso`: lifts of `x` to the spectrum of a finite\n \u00e9tale `R`-algebra `A` are the `R`-algebra maps `A \u2192\u2090[R] \u03a9`, naturally in `A`.\n* `TauCeti.FiniteEtaleScheme.specCompFiberIso`: the geometric fibre at `x` of `Spec A` is\n `A \u2192\u2090[R] \u03a9`, naturally in the finite \u00e9tale `R`-algebra `A`.\n\n## Main results\n\n* `TauCeti.FiniteEtaleScheme.algSpec_map_specCompFiberIso_hom_app`: the algebra map attached to a\n point of the fibre has the corresponding lift of `x` as its spectrum.\n\n## References\n\n* A. Grothendieck, *SGA 1*, Expos\u00e9 V, \u00a7\u00a74\u20137.\n* H. W. Lenstra, *Galois theory for schemes*, Section 5.\n-/\n\npublic section\n\nopen CategoryTheory AlgebraicGeometry Opposite\n\nuniverse u\n\nnamespace TauCeti.FiniteEtaleScheme\n\nvariable (R : CommRingCat.{u}) (\u03a9 : Type u) [Field \u03a9] [Algebra R \u03a9]\n\n/-- The lifts of the point `Spec \u03a9 \u27f6 Spec R` to the spectrum of a finite \u00e9tale `R`-algebra `A`\nare the `R`-algebra maps `A \u2192\u2090[R] \u03a9`, naturally in `A`. This is\n`TauCeti.AlgebraicGeometry.algSpecHomEquivAlgHom` on finite \u00e9tale algebras. -/\nnoncomputable def algSpecCompCoyonedaIso :\n (CommAlgCat.finiteEtale R).\u03b9.op \u22d9 algSpec R \u22d9\n coyoneda.obj (op (Over.mk (Spec.map (CommRingCat.ofHom (algebraMap R \u03a9))))) \u2245\n CommAlgCat.FiniteEtale.fiber R \u03a9 \u22d9 FintypeCat.incl :=\n NatIso.ofComponents\n (fun A \u21a6 (AlgebraicGeometry.algSpecHomEquivAlgHom A.unop.obj (.of R \u03a9)).toIso)\n fun {A B} f \u21a6 by\n ext g\n suffices AlgebraicGeometry.algSpecHomEquivAlgHom B.unop.obj (.of R \u03a9)\n (g \u226b (algSpec _).map f.unop.hom.op) =\n (AlgebraicGeometry.algSpecHomEquivAlgHom A.unop.obj (.of R \u03a9) g).comp\n f.unop.hom.hom by\n simpa\n exact AlgebraicGeometry.algSpecHomEquivAlgHom_comp (A := A.unop.obj) (B := .of R \u03a9)\n f.unop.hom g\n\n/-- The components of `algSpecCompCoyonedaIso` are `algSpecHomEquivAlgHom`. -/\ntheorem algSpecCompCoyonedaIso_hom_app_apply (A : (CommAlgCat.FiniteEtale.{u} R)\u1d52\u1d56)\n (g : ((CommAlgCat.finiteEtale R).\u03b9.op \u22d9 algSpec R \u22d9\n coyoneda.obj (op (Over.mk (Spec.map (CommRingCat.ofHom (algebraMap R \u03a9)))))).obj A) :\n (algSpecCompCoyonedaIso R \u03a9).hom.app A g =\n AlgebraicGeometry.algSpecHomEquivAlgHom A.unop.obj (.of R \u03a9) g :=\n (rfl)\n\nvariable [IsSepClosed \u03a9]\n\n/-- The underlying isomorphism of types of `specCompFiberIso`. -/\nprivate noncomputable def specCompFiberCompInclIso :\n (spec R \u22d9 fiber (Spec.map (CommRingCat.ofHom (algebraMap R \u03a9)))) \u22d9 FintypeCat.incl \u2245\n CommAlgCat.FiniteEtale.fiber R \u03a9 \u22d9 FintypeCat.incl :=\n Functor.associator _ _ _ \u226a\u226b Functor.isoWhiskerLeft (spec R) (fiberCompInclIso _) \u226a\u226b\n (Functor.associator _ _ _).symm \u226a\u226b\n -- `spec R` followed by the inclusion into `Over (Spec R)` is `algSpec R` (`spec_comp_\u03b9`).\n Functor.isoWhiskerRight (eqToIso (spec_comp_\u03b9 R)) _ \u226a\u226b Functor.associator _ _ _ \u226a\u226b\n algSpecCompCoyonedaIso R \u03a9\n\n/-- **The geometric fibre of the spectrum of a finite \u00e9tale algebra is its set of\n`\u03a9`-points.** For a separably closed `R`-algebra `\u03a9`, the geometric fibre at\n`Spec \u03a9 \u27f6 Spec R` of the spectrum of a finite \u00e9tale `R`-algebra `A` is the finite set\n`A \u2192\u2090[R] \u03a9`, naturally in `A`. A point of the fibre goes to the `R`-algebra map whose spectrum\nis the corresponding lift of the geometric point (`algSpec_map_specCompFiberIso_hom_app`). -/\nnoncomputable def specCompFiberIso :\n spec R \u22d9 fiber (Spec.map (CommRingCat.ofHom (algebraMap R \u03a9))) \u2245\n CommAlgCat.FiniteEtale.fiber R \u03a9 :=\n Functor.fullyFaithfulCancelRight FintypeCat.incl (specCompFiberCompInclIso R \u03a9)\n\n", "statement": "/-- The algebra map that `specCompFiberIso` attaches to a point `y` of the geometric fibre of\n`Spec A` has as spectrum the lift of the geometric point to `Spec A` given by `y`. -/\ntheorem algSpec_map_specCompFiberIso_hom_app (A : (CommAlgCat.FiniteEtale.{u} R)\u1d52\u1d56)\n (y : (fiber (Spec.map (CommRingCat.ofHom (algebraMap R \u03a9)))).obj ((spec R).obj A)) :\n (algSpec R).map (CommAlgCat.ofHom ((specCompFiberIso R \u03a9).hom.app A y)).op =\n (fiberCompInclIso _).hom.app ((spec R).obj A) y \u226b eqToHom (spec_obj_obj R A) ", "proof": " by\n have h : (specCompFiberIso R \u03a9).hom.app A y = (specCompFiberCompInclIso R \u03a9).hom.app A y := by\n have := FintypeCat.incl.map_preimage ((specCompFiberCompInclIso R \u03a9).hom.app A)\n rw [ObjectProperty.\u03b9_map] at this\n rw [specCompFiberIso, Functor.fullyFaithfulCancelRight_hom_app, \u2190 FintypeCat.hom_apply, this]\n rw [h]\n -- Unfolding `specCompFiberCompInclIso`, the algebra map is `algSpecHomEquivAlgHom` of the lift.\n simp only [specCompFiberCompInclIso, Iso.trans_hom, Functor.isoWhiskerLeft_hom, Iso.symm_hom,\n Functor.isoWhiskerRight_hom, eqToIso.hom, NatTrans.comp_app, Functor.comp_obj,\n Functor.associator_hom_app, Functor.whiskerLeft_app, Functor.associator_inv_app,\n Functor.whiskerRight_app, eqToHom_app, Category.id_comp, comp_apply]\n rw [algSpecCompCoyonedaIso_hom_app_apply]\n exact AlgebraicGeometry.algSpec_map_algSpecHomEquivAlgHom _", "proof_lines": 12, "proof_length": 737, "rev": "75c8aed5fea63047615a25a9763fd5b68a86e891", "heartbeats": 1881, "image": "lean-compression:tauceti-75c8aed5fe-a608030cfc", "split": "dev"} {"path": "TauCeti/RingTheory/FormalGroup/Module/Height/Basic.lean", "module": "TauCeti.RingTheory.FormalGroup.Module.Height.Basic", "theorem": "TauCeti.FormalModule.height_eq_natCast_iff", "prefix": "/-\nCopyright (c) 2026 The Tau Ceti contributors. All rights reserved.\nReleased under Apache 2.0 license as described in the file LICENSE.\nAuthors: The Tau Ceti contributors\n-/\nmodule\n\npublic import TauCeti.RingTheory.FormalGroup.Module.Basic\npublic import Mathlib.RingTheory.DiscreteValuationRing.Basic\nimport TauCeti.RingTheory.FormalGroup.Height.Basic\nimport TauCeti.RingTheory.LocalRing.Module\nimport TauCeti.RingTheory.PowerSeries.Order\nimport Mathlib.FieldTheory.Finite.GaloisField\n\n/-!\n# Height of a formal module\n\nFor a formal module over a local ring `R` with scalars in a DVR `O`, the height is computed on\nthe special fibre. It is infinite when the reduced uniformizer action is zero. Otherwise it is\nthe logarithm of the order of that action with base `Nat.card (ResidueField O)`.\n\nFor finite residue cardinality `q`, the reduced uniformizer action has order `q ^ h` exactly\nwhen the formal module has height `h`. Any uniformizer gives the same height, and local base\nchange and changes of formal coordinate preserve it. The order characterization also lets\none compare heights under restriction of scalars by comparing the two uniformizer actions.\n\n## References\n\n* E. Viehmann and K. Ziegler, *Formal moduli of formal O_K-modules*, Ast\u00e9risque 312 (2007),\n 57\u201366, Lemma 2.1 and Definition 2.2.\n-/\n\npublic section\n\nopen IsLocalRing\n\nnamespace TauCeti.FormalModule\n\nvariable {O R : Type*} [CommRing O] [CommRing R] [Algebra O R] {F G : FormalGroup R}\n\nnamespace Hom\n\nvariable {\u03c1 : FormalModule O F} {\u03c4 : FormalModule O G}\n\n/-- The leading degree of a formal-module homomorphism fixes every residue scalar under\nexponentiation, even when the leading coefficient is a zero divisor. -/\ntheorem pow_eq_self_of_order [IsLocalRing O] (f : Hom \u03c1 \u03c4) {n : \u2115}\n (hn : f.toPowerSeries.order = n) (x : ResidueField O) : x ^ n = x := by\n obtain \u27e8a, rfl\u27e9 := residue_surjective x\n have h := congrArg (fun g : FormalGroupHom F G \u21a6 PowerSeries.coeff n g.toPowerSeries)\n (f.comp_act a)\n simp only [FormalGroupHom.comp_toPowerSeries] at h\n rw [PowerSeries.coeff_subst_eq_mul_pow (\u03c1.act a).zero_constantCoeff hn.ge,\n PowerSeries.coeff_subst_eq_mul f.zero_constantCoeff (\u03c4.act a).zero_constantCoeff hn.ge] at h\n simp only [Algebra.algebraMap_self_apply, coeff_one_act] at h\n rw [\u2190 sub_eq_zero, \u2190 map_pow, \u2190 map_sub, residue_eq_zero_iff]\n apply IsLocalRing.mem_maximalIdeal_of_smul_eq_zero (PowerSeries.order_eq_nat.mp hn).1\n rw [Algebra.smul_def, map_sub, map_pow]\n linear_combination h\n\n/-- A nonzero formal-module homomorphism has order a power of the residue cardinality of\nthe local scalar ring. If the residue field is infinite, only order one is possible. -/\ntheorem exists_order_eq_pow [IsLocalRing O] (f : Hom \u03c1 \u03c4) (hf : f.toPowerSeries \u2260 0) :\n \u2203 h : \u2115, f.toPowerSeries.order = (Nat.card (ResidueField O) ^ h : \u2115) := by\n obtain \u27e8n, hn\u27e9 := ENat.ne_top_iff_exists.mp (PowerSeries.order_eq_top.not.mpr hf)\n by_cases h1 : n = 1\n \u00b7 exact \u27e80, by simpa [h1] using hn.symm\u27e9\n have hn0 := PowerSeries.toNat_order_ne_zero f.zero_constantCoeff hf\n rw [\u2190 hn, ENat.toNat_natCast] at hn0\n -- In degree greater than one all residue scalars are roots of a nonzero polynomial X^n - X.\n have : Finite (ResidueField O) := by\n by_contra! hinf\n have heq : (Polynomial.X : Polynomial (ResidueField O)) ^ n = Polynomial.X :=\n Polynomial.funext fun x \u21a6 by simpa using f.pow_eq_self_of_order hn.symm x\n exact h1 (by simpa using congrArg Polynomial.natDegree heq)\n let p := ringChar (ResidueField O)\n have hp : Fact p.Prime := \u27e8CharP.char_is_prime (ResidueField O) p\u27e9\n -- The binomial gcd annihilates the leading coefficient, so its residue is zero.\n have hd : (lazardGcd n : O) \u2208 maximalIdeal O := by\n apply IsLocalRing.mem_maximalIdeal_of_smul_eq_zero (PowerSeries.order_eq_nat.mp hn.symm).1\n simpa only [Algebra.smul_def, map_natCast, mul_comm] using\n F.coeff_mul_lazardGcd_eq_zero_of_le_order G f.hom hn.le\n have hd' := (residue_eq_zero_iff _).2 hd\n rw [map_natCast, CharP.cast_eq_zero_iff (ResidueField O) p] at hd'\n obtain \u27e8i, rfl\u27e9 := (prime_dvd_lazardGcd_iff hp.out hn0).mp hd'\n let : Algebra (ZMod p) (ResidueField O) := ZMod.algebra _ _\n have hdiv : Module.finrank (ZMod p) (ResidueField O) \u2223 i := by\n rw [\u2190 FiniteField.orderOf_frobeniusAlgHom]\n apply orderOf_dvd_of_pow_eq_one\n ext x\n simpa only [AlgHom.coe_pow, FiniteField.coe_frobeniusAlgHom, pow_iterate, ZMod.card,\n AlgHom.one_apply] using! f.pow_eq_self_of_order hn.symm x\n obtain \u27e8h, rfl\u27e9 := hdiv\n exact \u27e8h, by simpa only [pow_mul, FiniteField.pow_finrank_eq_natCard] using hn.symm\u27e9\n\nend Hom\n\nvariable (\u03c1 : FormalModule O F)\n\nsection Local\n\nvariable [IsDomain O] [IsDiscreteValuationRing O] [IsLocalRing R]\n\n/-- The height of a formal module over a local base is read on its special fibre. It is\ninfinite when the uniformizer acts by zero there. For finite residue cardinality `q`, finite\nheight `h` means that the reduced action has order `q ^ h`. -/\nnoncomputable def height : \u2115\u221e :=\n let \u03c0 := (IsDiscreteValuationRing.exists_irreducible O).choose\n ENat.map (Nat.log (Nat.card (ResidueField O)))\n (\u03c1.specialFiber.act \u03c0).toPowerSeries.order\n\n/-- Any uniformizer can be used to compute the height on the special fibre. -/\ntheorem height_eq_of_irreducible {\u03c0 : O} (h\u03c0 : Irreducible \u03c0) :\n \u03c1.height = ENat.map (Nat.log (Nat.card (ResidueField O)))\n (\u03c1.specialFiber.act \u03c0).toPowerSeries.order := by\n unfold height\n apply congrArg (ENat.map (Nat.log (Nat.card (ResidueField O))))\n exact \u03c1.specialFiber.order_act_eq_of_associated\n (IsDiscreteValuationRing.associated_of_irreducible O\n (IsDiscreteValuationRing.exists_irreducible O).choose_spec h\u03c0)\n\n/-- Infinite height means that the uniformizer acts by zero on the special fibre. -/\ntheorem height_eq_top_iff {\u03c0 : O} (h\u03c0 : Irreducible \u03c0) :\n \u03c1.height = \u22a4 \u2194 (\u03c1.specialFiber.act \u03c0).toPowerSeries = 0 := by\n rw [\u03c1.height_eq_of_irreducible h\u03c0]\n exact ENat.map_eq_top_iff.trans PowerSeries.order_eq_top\n\n", "statement": "/-- Finite height is characterized by the first nonzero degree of the reduced uniformizer action. -/\ntheorem height_eq_natCast_iff {\u03c0 : O} (h\u03c0 : Irreducible \u03c0) {h : \u2115} :\n \u03c1.height = h \u2194 (\u03c1.specialFiber.act \u03c0).toPowerSeries.order =\n (Nat.card (ResidueField O) ^ h : \u2115) ", "proof": " by\n rw [\u03c1.height_eq_of_irreducible h\u03c0, \u2190 actHom_toFormalGroupHom]\n set \u03c6 := \u03c1.specialFiber.actHom \u03c0\n by_cases hz : \u03c6.toPowerSeries = 0\n \u00b7 rw [hz, PowerSeries.order_zero, ENat.map_top]\n exact iff_of_false (ENat.top_ne_natCast _) (ENat.top_ne_natCast _)\n obtain \u27e8i, hi\u27e9 := \u03c6.exists_order_eq_pow hz\n rcases finite_or_infinite (ResidueField O) with hfin | hinf\n \u00b7 have hq : 1 < Nat.card (ResidueField O) := Finite.one_lt_card\n rw [hi, ENat.map_natCast, Nat.log_pow hq]\n exact ENat.natCast_inj.trans ((Nat.pow_right_injective hq).eq_iff.symm.trans\n ENat.natCast_inj.symm)\n \u00b7 have hn := PowerSeries.order_ne_zero_iff_constCoeff_eq_zero.mpr \u03c6.zero_constantCoeff\n rw [Nat.card_eq_zero_of_infinite] at hi \u22a2\n -- An infinite residue field forces order one, since a positive exponent gives order zero.\n obtain rfl : i = 0 := by\n cases i with\n | zero => rfl\n | succ i =>\n exact (hn (by simpa only [pow_succ, mul_zero, Nat.cast_zero] using hi)).elim\n rw [hi, ENat.map_natCast]\n have heq : Nat.log 0 (0 ^ 0) = h \u2194 0 ^ 0 = (0 : \u2115) ^ h := by cases h <;> simp\n exact ENat.natCast_inj.trans (heq.trans ENat.natCast_inj.symm)", "proof_lines": 22, "proof_length": 992, "rev": "75c8aed5fea63047615a25a9763fd5b68a86e891", "heartbeats": 614, "image": "lean-compression:tauceti-75c8aed5fe-a608030cfc", "split": "dev"} {"path": "TauCeti/GroupTheory/FreeGroup/GenEq/Transformation.lean", "module": "TauCeti.GroupTheory.FreeGroup.GenEq.Transformation", "theorem": "TauCeti.GenEq.Transformation.transfersUniquely_ofFamily_iff", "prefix": "/-\nCopyright (c) 2026 The Tau Ceti contributors. All rights reserved.\nReleased under Apache 2.0 license as described in the file LICENSE.\nAuthors: The Tau Ceti contributors\n-/\nmodule\n\npublic import Mathlib.Basic.Finite.Sigma\npublic import TauCeti.GroupTheory.FreeGroup.GenEq.Basic\n\n/-!\n# Transformations of generalised equations\n\nA *transformation* of a generalised equation `\u03a9` (Kharlampovich\u2013Myasnikov, \u00a75.1) is a finite\nfamily of formally consistent generalised equations `\u03a9\u2081, \u2026, \u03a9_r`, the *successors* of `\u03a9`,\ntogether with surjective `F(A)`-homomorphisms `\u03b8\u1d62 : F_{R(\u03a9)} \u2192 F_{R(\u03a9\u1d62)}` of coordinate groups and\na map sending every solution `U` of `\u03a9` to a pair `(\u03a9\u1d62, U\u1d62)` of a successor and a solution of it\nsuch that `\u03c0_{U\u1d62} \u2218 \u03b8\u1d62 = \u03c0_U`, where `\u03c0_U : F_{R(\u03a9)} \u2192 F(A)` is the homomorphism of the solution\n`U`.\n\nThe source asks of an elementary transformation that the pair `(\u03a9\u1d62, U\u1d62)` be the only one making\nthe triangle commute; here this is the property\n`TauCeti.GenEq.Transformation.TransfersUniquely`, which every transformation with a single\nsuccessor has. Transformations compose (`TauCeti.GenEq.Transformation.bind`), and the derived\ntransformations of Makanin's process are such composites; uniqueness of the pair is not preserved\nby composition in general, because a solution of a later successor need only compose to a group\nsolution of an intermediate equation, which is why the transfer map is part of the data.\n\nIn the other direction, composing the homomorphism of a solution of a successor with `\u03b8\u1d62` always\ngives a point of `\u03a9*` in `F(A)` (`TauCeti.GenEq.Transformation.solution_backward`), in general not\na solution of `\u03a9`: adjacent words may cancel.\n\n## Main definitions\n\n* `TauCeti.GenEq.Transformation`: transformations of a generalised equation.\n* `TauCeti.GenEq.Transformation.id`: the identity transformation.\n* `TauCeti.GenEq.Transformation.bind`, `TauCeti.GenEq.Transformation.andThen`: composition of\n transformations.\n* `TauCeti.GenEq.Transformation.ofFamily`: the transformation whose successors are the formally\n consistent members of a finite family of generalised equations.\n* `TauCeti.GenEq.Transformation.TransfersUniquely`: every solution has exactly one transfer.\n\n## Main results\n\n* `TauCeti.GenEq.Transformation.solution_forward`: if a transformation transfers solutions\n uniquely, every solution of `\u03a9` corresponds to exactly one pair of a successor and a solution\n of it.\n* `TauCeti.GenEq.Transformation.solution_backward`: a solution of a successor composes to a point\n of `\u03a9*` in `F(A)`.\n* `TauCeti.GenEq.Transformation.transfersUniquely_of_subsingleton`: a transformation with at most\n one successor transfers solutions uniquely; in particular the identity does.\n* `TauCeti.GenEq.Transformation.transfersUniquely_ofFamily_iff`: for the transformation given by\n a family, uniqueness of the pair may be checked over all members of the family, formally\n consistent or not.\n\n## References\n\n* O. Kharlampovich, A. Myasnikov, *Implicit function theorem over free groups*, J. Algebra 290\n (2005), \u00a75.1.\n-/\n\npublic section\n\nnamespace TauCeti\n\nnamespace GenEq\n\nopen GroupAlgGeom Monoid.Coprod\n\nvariable {A : Type*}\n\n/-- A transformation of a generalised equation `\u03a9` (Kharlampovich\u2013Myasnikov, \u00a75.1): a finite\nfamily of formally consistent generalised equations, each with a surjective `F(A)`-homomorphism\nfrom the coordinate group of `\u03a9`, and a transfer of every solution of `\u03a9` to a solution of a\nmember of the family through which the homomorphism of the solution factors. The equation `\u03a9`\nitself is not required to be formally consistent; if it is not, it has no solution. -/\nstructure Transformation (\u03a9 : GenEq A) where\n /-- The index set of the successors. -/\n \u03b9 : Type\n /-- There are finitely many successors. -/\n finite : Finite \u03b9\n /-- The successors. -/\n target : \u03b9 \u2192 GenEq A\n /-- The successors are formally consistent. -/\n isFormallyConsistent_target : \u2200 i, (target i).IsFormallyConsistent\n /-- The `F(A)`-homomorphism from the coordinate group of `\u03a9` to that of a successor. -/\n hom : \u2200 i, GHom (CoordGroup.coeff (.id (FreeGroup A)) \u03a9.toSystem)\n (CoordGroup.coeff (.id (FreeGroup A)) (target i).toSystem)\n /-- The homomorphisms to the successors are surjective. -/\n hom_surjective : \u2200 i, Function.Surjective (hom i)\n /-- The transfer of a solution of `\u03a9` to a successor. -/\n transfer : \u03a9.Solution \u2192 (i : \u03b9) \u00d7 (target i).Solution\n /-- The homomorphism of a solution factors through the homomorphism of its transfer. -/\n toHom_transfer : \u2200 U, (transfer U).2.toHom.comp (hom (transfer U).1) = U.toHom\n\nnamespace Transformation\n\nattribute [instance] Transformation.finite\n\nvariable {\u03a9 : GenEq A}\n\n/-- The identity transformation of a formally consistent generalised equation: its only successor\nis `\u03a9`, with the identity homomorphism, and every solution is transferred to itself. -/\n@[expose] def id (\u03a9 : GenEq A) (h\u03a9 : \u03a9.IsFormallyConsistent) : Transformation \u03a9 where\n \u03b9 := Unit\n finite := inferInstance\n target _ := \u03a9\n isFormallyConsistent_target _ := h\u03a9\n hom _ := GHom.id _\n hom_surjective _ := by\n rw [GHom.coe_id]\n exact Function.surjective_id\n transfer U := \u27e8(), U\u27e9\n toHom_transfer _ := GHom.comp_id _\n\n/-- The only successor of the identity transformation is `\u03a9` itself. -/\n@[simp]\ntheorem id_target (h\u03a9 : \u03a9.IsFormallyConsistent) (i : (Transformation.id \u03a9 h\u03a9).\u03b9) :\n (Transformation.id \u03a9 h\u03a9).target i = \u03a9 :=\n (rfl)\n\n/-- The identity transformation carries the identity homomorphism of coordinate groups. -/\n@[simp]\ntheorem id_hom (h\u03a9 : \u03a9.IsFormallyConsistent) (i : (Transformation.id \u03a9 h\u03a9).\u03b9) :\n (Transformation.id \u03a9 h\u03a9).hom i = GHom.id _ :=\n (rfl)\n\n/-- The identity transformation leaves every solution unchanged. -/\n@[simp]\ntheorem id_transfer (h\u03a9 : \u03a9.IsFormallyConsistent) (U : \u03a9.Solution) :\n (Transformation.id \u03a9 h\u03a9).transfer U = \u27e8(), U\u27e9 :=\n (rfl)\n\n/-- Composition of transformations: apply `T`, then to each successor `T.target i` the\ntransformation `S i`. The successors are those of the `S i`, with the composite homomorphisms and\nthe composite transfer. -/\n@[expose] def bind (T : Transformation \u03a9) (S : \u2200 i, Transformation (T.target i)) :\n Transformation \u03a9 where\n \u03b9 := (i : T.\u03b9) \u00d7 (S i).\u03b9\n finite := inferInstance\n target p := (S p.1).target p.2\n isFormallyConsistent_target p := (S p.1).isFormallyConsistent_target p.2\n hom p := ((S p.1).hom p.2).comp (T.hom p.1)\n hom_surjective p := by\n rw [GHom.coe_comp]\n exact ((S p.1).hom_surjective p.2).comp (T.hom_surjective p.1)\n transfer U :=\n \u27e8\u27e8(T.transfer U).1, ((S (T.transfer U).1).transfer (T.transfer U).2).1\u27e9,\n ((S (T.transfer U).1).transfer (T.transfer U).2).2\u27e9\n toHom_transfer U := by\n rw [\u2190 GHom.comp_assoc, (S (T.transfer U).1).toHom_transfer, T.toHom_transfer]\n\n/-- The successors of a composite are the successors of the second transformations. -/\n@[simp]\ntheorem bind_target (T : Transformation \u03a9) (S : \u2200 i, Transformation (T.target i))\n (p : (T.bind S).\u03b9) : (T.bind S).target p = (S p.1).target p.2 :=\n (rfl)\n\n/-- The homomorphism to a successor of a composite is the composite of the homomorphisms. -/\n@[simp]\ntheorem bind_hom (T : Transformation \u03a9) (S : \u2200 i, Transformation (T.target i)) (p : (T.bind S).\u03b9) :\n (T.bind S).hom p = ((S p.1).hom p.2).comp (T.hom p.1) :=\n (rfl)\n\n/-- A composite transfers a solution first by `T`, then by the transformation applied to the\nsuccessor receiving it. -/\n@[simp]\ntheorem bind_transfer (T : Transformation \u03a9) (S : \u2200 i, Transformation (T.target i))\n (U : \u03a9.Solution) : (T.bind S).transfer U =\n \u27e8\u27e8(T.transfer U).1, ((S (T.transfer U).1).transfer (T.transfer U).2).1\u27e9,\n ((S (T.transfer U).1).transfer (T.transfer U).2).2\u27e9 :=\n (rfl)\n\n/-- Composition with a transformation defined for every formally consistent generalised\nequation: apply `T`, then `S` to each successor. -/\nabbrev andThen (T : Transformation \u03a9)\n (S : \u2200 \u03a9' : GenEq A, \u03a9'.IsFormallyConsistent \u2192 Transformation \u03a9') : Transformation \u03a9 :=\n T.bind fun i => S (T.target i) (T.isFormallyConsistent_target i)\n\n/-- Composing the homomorphism of a solution of a successor with the homomorphism of the\ntransformation gives a point of `\u03a9*` in `F(A)`: a group solution of `\u03a9`. -/\ntheorem solution_backward (T : Transformation \u03a9) (i : T.\u03b9) (U' : (T.target i).Solution) :\n (fun k => U'.toHom (T.hom i ((inr (FreeGroup.of k) : GX (FreeGroup A) (Fin \u03a9.numItems)) :\n \u03a9.coordGroup))) \u2208 V (MonoidHom.id (FreeGroup A)) \u03a9.toSystem := by\n convert (CoordGroup.homEquiv _ _ (U'.toHom.comp (T.hom i))).property using 1\n ext k\n simp\n\n/-- Two solutions of a successor whose homomorphisms agree after composition with the\nhomomorphism of the transformation are equal. -/\ntheorem eq_of_toHom_comp_hom_eq (T : Transformation \u03a9) (i : T.\u03b9) {U\u2081 U\u2082 : (T.target i).Solution}\n (h : U\u2081.toHom.comp (T.hom i) = U\u2082.toHom.comp (T.hom i)) : U\u2081 = U\u2082 := by\n refine Solution.point_injective (funext fun k => ?_)\n obtain \u27e8y, hy\u27e9 := T.hom_surjective i\n ((inr (FreeGroup.of k) : GX (FreeGroup A) (Fin (T.target i).numItems)) :\n (T.target i).coordGroup)\n simpa [hy] using DFunLike.congr_fun h y\n\n/-- A transformation transfers solutions uniquely when, for every solution `U` of `\u03a9`, the\ntransfer of `U` is the only pair of a successor and a solution of it through which the\nhomomorphism of `U` factors. Successors with different indices are different pairs, even if they\nare equal generalised equations. -/\ndef TransfersUniquely (T : Transformation \u03a9) : Prop :=\n \u2200 (U : \u03a9.Solution) (p : (i : T.\u03b9) \u00d7 (T.target i).Solution),\n p.2.toHom.comp (T.hom p.1) = U.toHom \u2192 p = T.transfer U\n\n/-- Unfolding `TransfersUniquely`. -/\ntheorem transfersUniquely_iff (T : Transformation \u03a9) : T.TransfersUniquely \u2194\n \u2200 (U : \u03a9.Solution) (p : (i : T.\u03b9) \u00d7 (T.target i).Solution),\n p.2.toHom.comp (T.hom p.1) = U.toHom \u2192 p = T.transfer U :=\n Iff.rfl\n\n/-- If a transformation transfers solutions uniquely, every solution of `\u03a9` corresponds to exactly\none pair of a successor and a solution of it making the triangle of homomorphisms commute. -/\ntheorem solution_forward {T : Transformation \u03a9} (hT : T.TransfersUniquely) (U : \u03a9.Solution) :\n \u2203! p : (i : T.\u03b9) \u00d7 (T.target i).Solution, p.2.toHom.comp (T.hom p.1) = U.toHom :=\n \u27e8T.transfer U, T.toHom_transfer U, fun p hp => hT U p hp\u27e9\n\n/-- A transformation with at most one successor transfers solutions uniquely. -/\ntheorem transfersUniquely_of_subsingleton (T : Transformation \u03a9) [Subsingleton T.\u03b9] :\n T.TransfersUniquely := by\n intro U \u27e8i, U'\u27e9 h\n have ht := T.toHom_transfer U\n generalize T.transfer U = q at ht \u22a2\n obtain \u27e8j, U''\u27e9 := q\n obtain rfl := Subsingleton.elim i j\n obtain rfl := T.eq_of_toHom_comp_hom_eq i (h.trans ht.symm)\n rfl\n\n/-- The identity transformation transfers solutions uniquely. -/\ntheorem transfersUniquely_id (h\u03a9 : \u03a9.IsFormallyConsistent) :\n (Transformation.id \u03a9 h\u03a9).TransfersUniquely :=\n have : Subsingleton (Transformation.id \u03a9 h\u03a9).\u03b9 := inferInstanceAs (Subsingleton Unit)\n transfersUniquely_of_subsingleton _\n\n/-! ### Transformations given by a family of generalised equations -/\n\nsection ofFamily\n\nvariable {\u03ba : Type} [Finite \u03ba] (target : \u03ba \u2192 GenEq A)\n (hom : \u2200 k, GHom (CoordGroup.coeff (.id (FreeGroup A)) \u03a9.toSystem)\n (CoordGroup.coeff (.id (FreeGroup A)) (target k).toSystem))\n (hom_surjective : \u2200 k, Function.Surjective (hom k))\n (transfer : \u03a9.Solution \u2192 (k : \u03ba) \u00d7 (target k).Solution)\n (toHom_transfer : \u2200 U, (transfer U).2.toHom.comp (hom (transfer U).1) = U.toHom)\n\n/-- The transformation whose successors are the formally consistent members of a finite family\nof generalised equations with surjective homomorphisms from the coordinate group of `\u03a9`, given a\ntransfer of every solution of `\u03a9` to a member of the family. A member receiving a solution is\nformally consistent, so no transfer is lost. -/\n@[expose] def ofFamily : Transformation \u03a9 where\n \u03b9 := {k // (target k).IsFormallyConsistent}\n finite := inferInstance\n target i := target i.val\n isFormallyConsistent_target i := i.property\n hom i := hom i.val\n hom_surjective i := hom_surjective i.val\n transfer U := \u27e8\u27e8(transfer U).1, (transfer U).2.isFormallyConsistent\u27e9, (transfer U).2\u27e9\n toHom_transfer := toHom_transfer\n\n/-- The successors of `ofFamily` are the formally consistent members of the family. -/\n@[simp]\ntheorem ofFamily_target (i : (ofFamily target hom hom_surjective transfer toHom_transfer).\u03b9) :\n (ofFamily target hom hom_surjective transfer toHom_transfer).target i = target i.val :=\n (rfl)\n\n/-- The homomorphisms of `ofFamily` are those of the family. -/\n@[simp]\ntheorem ofFamily_hom (i : (ofFamily target hom hom_surjective transfer toHom_transfer).\u03b9) :\n (ofFamily target hom hom_surjective transfer toHom_transfer).hom i = hom i.val :=\n (rfl)\n\n/-- `ofFamily` transfers every solution to the member of the family chosen by the given\ntransfer, with the same solution. -/\n@[simp]\ntheorem ofFamily_transfer (U : \u03a9.Solution) :\n (ofFamily target hom hom_surjective transfer toHom_transfer).transfer U =\n \u27e8\u27e8(transfer U).1, (transfer U).2.isFormallyConsistent\u27e9, (transfer U).2\u27e9 :=\n (rfl)\n\nvariable {target hom hom_surjective transfer toHom_transfer} in\n", "statement": "/-- The transformation whose successors are the formally consistent members of a family transfers\nsolutions uniquely if and only if, for every solution `U` of `\u03a9`, the given transfer of `U` is the\nonly pair of a member of the family and a solution of it through which the homomorphism of `U`\nfactors. -/\ntheorem transfersUniquely_ofFamily_iff :\n (ofFamily target hom hom_surjective transfer toHom_transfer).TransfersUniquely \u2194\n \u2200 (U : \u03a9.Solution) (p : (k : \u03ba) \u00d7 (target k).Solution),\n p.2.toHom.comp (hom p.1) = U.toHom \u2192 p = transfer U ", "proof": " by\n refine \u27e8fun h U \u27e8k, U'\u27e9 hp => ?_, fun h U \u27e8\u27e8k, hk\u27e9, U'\u27e9 hp => ?_\u27e9\n \u00b7 have h' := h U \u27e8\u27e8k, U'.isFormallyConsistent\u27e9, U'\u27e9 hp\n rw [ofFamily_transfer] at h'\n generalize transfer U = q at h' \u22a2\n obtain \u27e8k', U''\u27e9 := q\n cases h'\n rfl\n \u00b7 have h' := h U \u27e8k, U'\u27e9 hp\n rw [ofFamily_transfer]\n generalize transfer U = q at h' \u22a2\n subst h'\n rfl", "proof_lines": 12, "proof_length": 319, "rev": "75c8aed5fea63047615a25a9763fd5b68a86e891", "heartbeats": 627, "image": "lean-compression:tauceti-75c8aed5fe-a608030cfc", "split": "dev"} {"path": "TauCeti/LinearAlgebra/Matrix/GramSize/Lengths.lean", "module": "TauCeti.LinearAlgebra.Matrix.GramSize.Lengths", "theorem": "TauCeti.GramSize.LengthsDifferLe.smul_sub_one_mem_matsOfSize", "prefix": "/-\nCopyright (c) 2026 The Tau Ceti contributors. All rights reserved.\nReleased under Apache 2.0 license as described in the file LICENSE.\nAuthors: The Tau Ceti contributors\n-/\nmodule\n\npublic import Mathlib.LinearAlgebra.Span.Defs\npublic import TauCeti.LinearAlgebra.Matrix.GramSize.Basic\npublic import TauCeti.LinearAlgebra.Matrix.IndefiniteUnitaryGroup\nimport Mathlib.Tactic.Module\nimport TauCeti.Algebra.Star.SelfAdjoint\nimport TauCeti.LinearAlgebra.Matrix.DotProduct\n\n/-!\n# Lengths of vectors at points of a unitary group, and their comparison at two points\n\nLet `S` be a size for the Gram matrix `J` of a sesquilinear form `\u27e8v, w\u27e9 = star v \u2b1d\u1d65 J *\u1d65 w` on\n`\u03b9 \u2192 A` (`TauCeti.GramSize`), and let `e\u2080, e\u2081, \u2026` be a family of vectors (in the application,\nthe basis vectors of an isotropic flag). For `l : \u2115`, a vector `\u03c9` is *orthogonal below `l`* if\n`\u27e8e_b, \u03c9\u27e9 = 0` for `b < l`, and two vectors are *congruent below `l`* if they differ by an element\nof the span of the `e_b`, `b < l`; the classes of the vectors orthogonal below `l` form the\nquotient `Y^(l)` along the flag.\n\nA size has no scale of its own; the phrase *length at most `L ^ i`* is informal notation for\nsize `i`, so named because for the size `TauCeti.GramSize.ofNorm L` at a real place, size `i`\nmeans norm at most `L ^ i`. The exponents below are sizes in this sense.\n\n* A vector `y` has **length at most `L ^ i` at `g`** if `g\u207b\u00b9 y` has size `i`\n (`TauCeti.GramSize.LengthLeAt`); its class in `Y^(l)` has **induced length at most `L ^ i`** if\n some vector congruent to `y` below `l` does (`TauCeti.GramSize.InducedLengthLe`).\n* For a unit `\u03c1` and two invertible matrices `g` and `g'`, a vector `\u03c9`, read at `g`, **agrees\n modulo `\u03c1` up to size `i` with a lift of its class in `Y^(l)` read at `g'`** if\n `(g\u207b\u00b9 \u03c9 - g'\u207b\u00b9 \u03c9') / \u03c1` has size `i` for some `\u03c9'` congruent to `\u03c9` below `l`\n (`TauCeti.GramSize.AgreesWithLift`). The **lengths at `g` and `g'` differ by at most `L ^ t` on\n `Y^(l)` modulo `\u03c1`** if every vector orthogonal below `l` of length at most `L ^ i` at `g` agrees\n in this way up to size `i + t` (`TauCeti.GramSize.LengthsDifferLe`).\n* The vector `e_a` **has a short dual of exponent `c`** for `(g, g')` modulo `\u03c1` if some dual `\u03b6`\n of `e_a` (orthogonal below `a`, with `\u27e8e_a, \u03b6\u27e9 = 1`) has length at most `L ^ c` at `g` and agrees\n modulo `\u03c1` up to size `c` with a lift of its class in `Y^(a)` read at `g'`\n (`TauCeti.GramSize.HasShortDual`).\n\nThe first two results compare the lengths at two points `g` and `g'` of the unitary group of a\nHermitian form, for a self-adjoint unit `\u03c1` of size `1`:\n\n* if `e_b` is orthogonal to `e_0, \u2026, e_a` for every `b < a`, the class of `e_a` in `Y^(a)` has\n induced length at most `L ^ c` at `g` and at `g'`, `e_a` has a short dual of exponent `c`, and\n the lengths differ by at most `L ^ t` on `Y^(a + 1)`, then they differ by at most\n `L ^ (t + 4c + 12)` on `Y^(a)` (`TauCeti.GramSize.LengthsDifferLe.of_succ`);\n* by induction, if `\u27e8e_b, e_b'\u27e9 = 0` for all `b, b' < j` (the `e_b`, `b < j`, span a totally\n isotropic subspace), the hypotheses on the class and the dual of `e_a` hold for every\n `a < j`, and the lengths differ by at most `L ^ t` on `Y^(j)`, then they differ by at most\n `L ^ (t + (4c + 12) j)` on the whole space `Y^(0)`\n (`TauCeti.GramSize.LengthsDifferLe.zero_of_hasShortDual`).\n\nThe third holds for any invertible Gram matrix `J` and self-adjoint unit `\u03c1`:\n\n* if the lengths at `g` and `g x` differ by at most `L ^ i` on the whole space, for `x` in the\n unitary group, then `(x - 1) / \u03c1` has size `i + 4`\n (`TauCeti.GramSize.LengthsDifferLe.smul_sub_one_mem_matsOfSize`): `x` is close to `1`.\n\nThe proof of the first statement splits a vector `\u03c9` orthogonal below `a` as\n`\u03c9 = \u03c9\u2080 + \u27e8e_a, \u03c9\u27e9 \u03b6` along the dual `\u03b6`, with `\u03c9\u2080` orthogonal below `a + 1`. The component `\u03c9\u2080`\nis compared by hypothesis; its lift `\u03c9\u2080'` is congruent to `\u03c9\u2080` only below `a + 1`, and its\ncoefficient along `e_a`, read off by the dual, is replaced by a short representative of `e_a` at\n`g'`. The coefficient `\u27e8e_a, \u03c9\u27e9` is the value of the form at `g\u207b\u00b9` of a short representative of\n`e_a` and `g\u207b\u00b9 \u03c9`, which bounds its size.\n\nThese estimates compare orbital integrals of Bessel functions at two points of a unitary group\nwith a Bessel subgroup, in the analysis of second moments of Poincar\u00e9 series.\n\n## Provenance\n\nThe definitions and the three comparison statements follow the Lean project grh-lean\n(https://github.com/lsernau/grh-lean, Apache 2.0, Copyright 2026 Anthropic, PBC), files\n`src/New/Spanning/Frames/Lengths.lean` (`New.Floors.Size.LengthLeAt`,\n`New.Floors.Size.InducedLengthLe`, `New.Floors.Size.GaugesDifferLe`,\n`New.Floors.Size.HasShortDual`) and `src/New/Spanning/Frames/TwoGauges.lean`\n(`New.Floors.Size.GaugesDifferLe.of_succ`,\n`New.Floors.Size.GaugesDifferLe.on_whole_space_of_hasShortDual`,\n`New.Floors.Size.GaugesDifferLe.hasMatrixSize_sub_one`). Here the flag is any family of vectors\nwith the isotropy used by the proof, and the points need only be invertible in the definitions.\n-/\n\npublic section\n\nopen Matrix\n\nnamespace TauCeti\n\nnamespace GramSize\n\nvariable {\u03b9 A : Type*} [Fintype \u03b9] [DecidableEq \u03b9] [CommRing A] [StarRing A]\n {J : Matrix \u03b9 \u03b9 A} (S : GramSize J)\n\n/-- A vector `y` has **length at most `L ^ i` at `g`** when `g\u207b\u00b9 y` has size `i`. Here `L ^ i` is\ninformal notation for size `i` (for `TauCeti.GramSize.ofNorm L`, the entries of `g\u207b\u00b9 y` have norm\nat most `L ^ i`); a size has no scale `L` of its own. -/\ndef LengthLeAt (g : GL \u03b9 A) (i : \u2115) (y : \u03b9 \u2192 A) : Prop :=\n ((g\u207b\u00b9 : GL \u03b9 A) : Matrix \u03b9 \u03b9 A) *\u1d65 y \u2208 S.vecsOfSize i\n\n/-- The class of `y` in the quotient `Y^(l)` along the flag `e` has **induced length at most\n`L ^ i` at `g`** when some vector congruent to `y` modulo the span of the `e_b`, `b < l`, has\nlength at most `L ^ i` at `g`. -/\ndef InducedLengthLe (e : \u2115 \u2192 \u03b9 \u2192 A) (l : \u2115) (g : GL \u03b9 A) (i : \u2115) (y : \u03b9 \u2192 A) : Prop :=\n \u2203 y', y - y' \u2208 Submodule.span A (e '' Set.Iio l) \u2227 S.LengthLeAt g i y'\n\n/-- A vector `\u03c9`, read at `g`, **agrees modulo `\u03c1` up to size `i` with a lift of its class in\n`Y^(l)` read at `g'`** when `(g\u207b\u00b9 \u03c9 - g'\u207b\u00b9 \u03c9') / \u03c1` has size `i` for some `\u03c9'` congruent to `\u03c9`\nmodulo the span of the `e_b`, `b < l`. -/\ndef AgreesWithLift (e : \u2115 \u2192 \u03b9 \u2192 A) (l : \u2115) (\u03c1 : A\u02e3) (g g' : GL \u03b9 A) (i : \u2115) (\u03c9 : \u03b9 \u2192 A) :\n Prop :=\n \u2203 \u03c9', \u03c9 - \u03c9' \u2208 Submodule.span A (e '' Set.Iio l) \u2227\n ((\u03c1\u207b\u00b9 : A\u02e3) : A) \u2022 (((g\u207b\u00b9 : GL \u03b9 A) : Matrix \u03b9 \u03b9 A) *\u1d65 \u03c9 -\n ((g'\u207b\u00b9 : GL \u03b9 A) : Matrix \u03b9 \u03b9 A) *\u1d65 \u03c9') \u2208 S.vecsOfSize i\n\n/-- The **lengths at `g` and `g'` differ by at most `L ^ t` on `Y^(l)` modulo `\u03c1`**: every vector\northogonal to the `e_b`, `b < l`, of length at most `L ^ i` at `g`, agrees modulo `\u03c1` up to size\n`i + t` with a lift of its class in `Y^(l)` read at `g'`. -/\ndef LengthsDifferLe (e : \u2115 \u2192 \u03b9 \u2192 A) (l : \u2115) (\u03c1 : A\u02e3) (g g' : GL \u03b9 A) (t : \u2115) : Prop :=\n \u2200 (i : \u2115) (\u03c9 : \u03b9 \u2192 A), (\u2200 b < l, star (e b) \u2b1d\u1d65 J *\u1d65 \u03c9 = 0) \u2192 S.LengthLeAt g i \u03c9 \u2192\n S.AgreesWithLift e l \u03c1 g g' (i + t) \u03c9\n\n/-- The vector `e_a` **has a short dual of exponent `c` for `(g, g')` modulo `\u03c1`**: some dual `\u03b6`\nof `e_a`, a vector orthogonal to the `e_b`, `b < a`, with `\u27e8e_a, \u03b6\u27e9 = 1`, has length at most\n`L ^ c` at `g` and, read at `g`, agrees modulo `\u03c1` up to size `c` with a lift of its class in\n`Y^(a)` read at `g'`. -/\ndef HasShortDual (e : \u2115 \u2192 \u03b9 \u2192 A) (a : \u2115) (\u03c1 : A\u02e3) (g g' : GL \u03b9 A) (c : \u2115) : Prop :=\n \u2203 \u03b6, (\u2200 b < a, star (e b) \u2b1d\u1d65 J *\u1d65 \u03b6 = 0) \u2227 star (e a) \u2b1d\u1d65 J *\u1d65 \u03b6 = 1 \u2227\n S.LengthLeAt g c \u03b6 \u2227 S.AgreesWithLift e a \u03c1 g g' c \u03b6\n\nvariable {S}\n\ntheorem lengthLeAt_iff {g : GL \u03b9 A} {i : \u2115} {y : \u03b9 \u2192 A} :\n S.LengthLeAt g i y \u2194 ((g\u207b\u00b9 : GL \u03b9 A) : Matrix \u03b9 \u03b9 A) *\u1d65 y \u2208 S.vecsOfSize i :=\n Iff.rfl\n\ntheorem inducedLengthLe_iff {e : \u2115 \u2192 \u03b9 \u2192 A} {l : \u2115} {g : GL \u03b9 A} {i : \u2115} {y : \u03b9 \u2192 A} :\n S.InducedLengthLe e l g i y \u2194\n \u2203 y', y - y' \u2208 Submodule.span A (e '' Set.Iio l) \u2227 S.LengthLeAt g i y' :=\n Iff.rfl\n\ntheorem agreesWithLift_iff {e : \u2115 \u2192 \u03b9 \u2192 A} {l : \u2115} {\u03c1 : A\u02e3} {g g' : GL \u03b9 A} {i : \u2115}\n {\u03c9 : \u03b9 \u2192 A} :\n S.AgreesWithLift e l \u03c1 g g' i \u03c9 \u2194 \u2203 \u03c9', \u03c9 - \u03c9' \u2208 Submodule.span A (e '' Set.Iio l) \u2227\n ((\u03c1\u207b\u00b9 : A\u02e3) : A) \u2022 (((g\u207b\u00b9 : GL \u03b9 A) : Matrix \u03b9 \u03b9 A) *\u1d65 \u03c9 -\n ((g'\u207b\u00b9 : GL \u03b9 A) : Matrix \u03b9 \u03b9 A) *\u1d65 \u03c9') \u2208 S.vecsOfSize i :=\n Iff.rfl\n\ntheorem lengthsDifferLe_iff {e : \u2115 \u2192 \u03b9 \u2192 A} {l : \u2115} {\u03c1 : A\u02e3} {g g' : GL \u03b9 A} {t : \u2115} :\n S.LengthsDifferLe e l \u03c1 g g' t \u2194 \u2200 (i : \u2115) (\u03c9 : \u03b9 \u2192 A),\n (\u2200 b < l, star (e b) \u2b1d\u1d65 J *\u1d65 \u03c9 = 0) \u2192 S.LengthLeAt g i \u03c9 \u2192\n S.AgreesWithLift e l \u03c1 g g' (i + t) \u03c9 :=\n Iff.rfl\n\ntheorem hasShortDual_iff {e : \u2115 \u2192 \u03b9 \u2192 A} {a : \u2115} {\u03c1 : A\u02e3} {g g' : GL \u03b9 A} {c : \u2115} :\n S.HasShortDual e a \u03c1 g g' c \u2194 \u2203 \u03b6, (\u2200 b < a, star (e b) \u2b1d\u1d65 J *\u1d65 \u03b6 = 0) \u2227\n star (e a) \u2b1d\u1d65 J *\u1d65 \u03b6 = 1 \u2227 S.LengthLeAt g c \u03b6 \u2227 S.AgreesWithLift e a \u03c1 g g' c \u03b6 :=\n Iff.rfl\n\n/-! ### Raising the exponents -/\n\n/-- A vector of length at most `L ^ i` at `g` has length at most `L ^ j` there for `i \u2264 j`. -/\ntheorem LengthLeAt.mono {g : GL \u03b9 A} {i j : \u2115} {y : \u03b9 \u2192 A} (h : S.LengthLeAt g i y)\n (hij : i \u2264 j) : S.LengthLeAt g j y :=\n lengthLeAt_iff.mpr (S.mem_vecsOfSize_of_le (lengthLeAt_iff.mp h) hij)\n\n/-- A vector of length at most `L ^ i` at `g` has a class of induced length at most `L ^ i`. -/\ntheorem LengthLeAt.inducedLengthLe {e : \u2115 \u2192 \u03b9 \u2192 A} {l : \u2115} {g : GL \u03b9 A} {i : \u2115} {y : \u03b9 \u2192 A}\n (h : S.LengthLeAt g i y) : S.InducedLengthLe e l g i y :=\n \u27e8y, by simp, h\u27e9\n\n/-- Induced lengths increase with the exponent. -/\ntheorem InducedLengthLe.mono {e : \u2115 \u2192 \u03b9 \u2192 A} {l : \u2115} {g : GL \u03b9 A} {i j : \u2115} {y : \u03b9 \u2192 A}\n (h : S.InducedLengthLe e l g i y) (hij : i \u2264 j) : S.InducedLengthLe e l g j y :=\n let \u27e8y', hy', hy'g\u27e9 := h\n \u27e8y', hy', hy'g.mono hij\u27e9\n\n/-- Agreement with a lift up to size `i` implies agreement up to every size `j \u2265 i`. -/\ntheorem AgreesWithLift.mono {e : \u2115 \u2192 \u03b9 \u2192 A} {l : \u2115} {\u03c1 : A\u02e3} {g g' : GL \u03b9 A} {i j : \u2115}\n {\u03c9 : \u03b9 \u2192 A} (h : S.AgreesWithLift e l \u03c1 g g' i \u03c9) (hij : i \u2264 j) :\n S.AgreesWithLift e l \u03c1 g g' j \u03c9 :=\n let \u27e8\u03c9', h\u03c9', hD\u27e9 := h\n \u27e8\u03c9', h\u03c9', S.mem_vecsOfSize_of_le hD hij\u27e9\n\n/-- Lengths differing by at most `L ^ t` differ by at most `L ^ t'` for `t \u2264 t'`. -/\ntheorem LengthsDifferLe.mono {e : \u2115 \u2192 \u03b9 \u2192 A} {l : \u2115} {\u03c1 : A\u02e3} {g g' : GL \u03b9 A} {t t' : \u2115}\n (h : S.LengthsDifferLe e l \u03c1 g g' t) (htt' : t \u2264 t') : S.LengthsDifferLe e l \u03c1 g g' t' :=\n fun i \u03c9 h\u03c9 h\u03c9g => (h i \u03c9 h\u03c9 h\u03c9g).mono (by omega)\n\n/-- A short dual of exponent `c` is a short dual of every exponent `c' \u2265 c`. -/\ntheorem HasShortDual.mono {e : \u2115 \u2192 \u03b9 \u2192 A} {a : \u2115} {\u03c1 : A\u02e3} {g g' : GL \u03b9 A} {c c' : \u2115}\n (h : S.HasShortDual e a \u03c1 g g' c) (hcc' : c \u2264 c') : S.HasShortDual e a \u03c1 g g' c' :=\n let \u27e8\u03b6, h\u03b6, h\u03b6a, h\u03b6g, hD\u27e9 := h\n \u27e8\u03b6, h\u03b6, h\u03b6a, h\u03b6g.mono hcc', hD.mono hcc'\u27e9\n\n/-! ### Comparing the lengths at two points -/\n\nvariable {e : \u2115 \u2192 \u03b9 \u2192 A} {\u03c1 : A\u02e3} {g g' : GL \u03b9 A}\n\n/-- The size of the coefficient `\u27e8e_a, \u03c9\u27e9` of a vector `\u03c9` orthogonal below `a` of length at most\n`L ^ i` at `g`, when the class of `e_a` in `Y^(a)` has induced length at most `L ^ c` at `g`. -/\nprivate theorem star_dotProduct_mulVec_mem_of_inducedLengthLe (hg : g \u2208 unitaryGroupOf J)\n {a c i : \u2115} {\u03c9 : \u03b9 \u2192 A} (h : S.InducedLengthLe e a g c (e a))\n (h\u03c9 : \u2200 b < a, star (e b) \u2b1d\u1d65 J *\u1d65 \u03c9 = 0) (h\u03c9g : S.LengthLeAt g i \u03c9) :\n star (e a) \u2b1d\u1d65 J *\u1d65 \u03c9 \u2208 S.ofSize (c + i + 3) := by\n obtain \u27e8e\u2081, he\u2081, he\u2081g\u27e9 := h\n rw [star_dotProduct_mulVec_eq_of_sub_mem_span (by rintro _ \u27e8b, hb, rfl\u27e9; exact h\u03c9 b hb) he\u2081,\n \u2190 mem_unitaryGroupOf_iff_forall_dotProduct.mp (inv_mem hg)]\n exact S.star_dotProduct_mulVec_mem (lengthLeAt_iff.mp he\u2081g) (lengthLeAt_iff.mp h\u03c9g)\n\n/-- The coefficient along `e_a` of the difference between a vector `\u03c9\u2080` orthogonal below `a + 1`\nand a lift `\u03c9\u2080'` of its class, divided by `\u03c1`, is small. It is read off by a short dual `\u03b6` of\n`e_a`, as a difference of two values of the form, at `g` and at `g'`. -/\nprivate theorem inv_mul_mem_of_add_eq_sub [Nonempty \u03b9] (hJ : J.IsHermitian)\n (hg : g \u2208 unitaryGroupOf J) (hg' : g' \u2208 unitaryGroupOf J) (h\u03c1 : IsSelfAdjoint (\u03c1 : A))\n (h\u03c1S : (\u03c1 : A) \u2208 S.ofSize 1) {a c i t : \u2115}\n (he : \u2200 b < a, \u2200 b' \u2264 a, star (e b) \u2b1d\u1d65 J *\u1d65 e b' = 0) {\u03b6 \u03b6' \u03c9\u2080 \u03c9\u2080' s : \u03b9 \u2192 A} {\u03bc : A}\n (h\u03b6 : \u2200 b < a, star (e b) \u2b1d\u1d65 J *\u1d65 \u03b6 = 0) (h\u03b6a : star (e a) \u2b1d\u1d65 J *\u1d65 \u03b6 = 1)\n (h\u03b6g : S.LengthLeAt g c \u03b6) (h\u03b6\u03b6' : \u03b6 - \u03b6' \u2208 Submodule.span A (e '' Set.Iio a))\n (hD\u2081 : ((\u03c1\u207b\u00b9 : A\u02e3) : A) \u2022 (((g\u207b\u00b9 : GL \u03b9 A) : Matrix \u03b9 \u03b9 A) *\u1d65 \u03b6 -\n ((g'\u207b\u00b9 : GL \u03b9 A) : Matrix \u03b9 \u03b9 A) *\u1d65 \u03b6') \u2208 S.vecsOfSize c)\n (h\u03c9\u2080 : \u2200 b < a + 1, star (e b) \u2b1d\u1d65 J *\u1d65 \u03c9\u2080 = 0) (h\u03c9\u2080g : S.LengthLeAt g i \u03c9\u2080)\n (hD\u2082 : ((\u03c1\u207b\u00b9 : A\u02e3) : A) \u2022 (((g\u207b\u00b9 : GL \u03b9 A) : Matrix \u03b9 \u03b9 A) *\u1d65 \u03c9\u2080 -\n ((g'\u207b\u00b9 : GL \u03b9 A) : Matrix \u03b9 \u03b9 A) *\u1d65 \u03c9\u2080') \u2208 S.vecsOfSize (i + t))\n (hs : s \u2208 Submodule.span A (e '' Set.Iio a)) (hys : \u03bc \u2022 e a + s = \u03c9\u2080 - \u03c9\u2080') :\n ((\u03c1\u207b\u00b9 : A\u02e3) : A) * \u03bc \u2208 S.ofSize (i + c + t + 6) := by\n -- `\u03bc = \u27e8\u03b6, \u03c9\u2080\u27e9 - \u27e8\u03b6, \u03c9\u2080'\u27e9`, since `\u27e8\u03b6, e_a\u27e9 = 1` and `\u03b6` is orthogonal to `s`.\n have h\u03bc : \u03bc = star \u03b6 \u2b1d\u1d65 J *\u1d65 \u03c9\u2080 - star \u03b6 \u2b1d\u1d65 J *\u1d65 \u03c9\u2080' := by\n have h\u03b6s : star \u03b6 \u2b1d\u1d65 J *\u1d65 s = 0 :=\n dotProduct_mulVec_eq_zero_of_mem_span (by\n rintro _ \u27e8b, hb, rfl\u27e9\n rw [\u2190 hJ.star_dotProduct_mulVec_comm, h\u03b6 b hb, star_zero]) hs\n have h\u03b6ea : star \u03b6 \u2b1d\u1d65 J *\u1d65 e a = 1 := by\n rw [\u2190 hJ.star_dotProduct_mulVec_comm, h\u03b6a, star_one]\n have := congrArg (fun v => star \u03b6 \u2b1d\u1d65 J *\u1d65 v) hys\n simpa only [mulVec_add, mulVec_smul, dotProduct_add, dotProduct_smul, smul_eq_mul, h\u03b6s, h\u03b6ea,\n mul_one, add_zero, mulVec_sub, dotProduct_sub] using this\n -- `\u03c9\u2080'` is still orthogonal below `a`, so `\u27e8\u03b6, \u03c9\u2080'\u27e9 = \u27e8\u03b6', \u03c9\u2080'\u27e9`.\n have h\u03c9\u2080' : \u2200 b < a, star (e b) \u2b1d\u1d65 J *\u1d65 \u03c9\u2080' = 0 := by\n intro b hb\n have hsp : \u03c9\u2080 - \u03c9\u2080' \u2208 Submodule.span A (e '' Set.Iio (a + 1)) := by\n rw [\u2190 hys]\n refine Submodule.add_mem _ (Submodule.smul_mem _ _ (Submodule.subset_span \u27e8a, by simp, rfl\u27e9))\n (Submodule.span_mono (Set.image_mono (Set.Iio_subset_Iio (Nat.le_succ a))) hs)\n have h0 := dotProduct_mulVec_eq_zero_of_mem_span\n (by rintro _ \u27e8b', hb', rfl\u27e9; exact he b hb b' (Nat.le_of_lt_succ hb')) hsp\n simpa [mulVec_sub, h\u03c9\u2080 b (by omega)] using h0\n have h\u03b6\u03b6'\u03c9\u2080' : star \u03b6 \u2b1d\u1d65 J *\u1d65 \u03c9\u2080' = star \u03b6' \u2b1d\u1d65 J *\u1d65 \u03c9\u2080' :=\n star_dotProduct_mulVec_eq_of_sub_mem_span (by rintro _ \u27e8b, hb, rfl\u27e9; exact h\u03c9\u2080' b hb) h\u03b6\u03b6'\n -- Read at `g\u207b\u00b9` and `g'\u207b\u00b9`, which preserve the form, `\u03bc` is a difference of two nearby values.\n have h\u03bc' : \u03bc = star (((g\u207b\u00b9 : GL \u03b9 A) : Matrix \u03b9 \u03b9 A) *\u1d65 \u03b6) \u2b1d\u1d65\n J *\u1d65 (((g\u207b\u00b9 : GL \u03b9 A) : Matrix \u03b9 \u03b9 A) *\u1d65 \u03c9\u2080) -\n star (((g'\u207b\u00b9 : GL \u03b9 A) : Matrix \u03b9 \u03b9 A) *\u1d65 \u03b6') \u2b1d\u1d65\n J *\u1d65 (((g'\u207b\u00b9 : GL \u03b9 A) : Matrix \u03b9 \u03b9 A) *\u1d65 \u03c9\u2080') := by\n rw [h\u03bc, h\u03b6\u03b6'\u03c9\u2080', mem_unitaryGroupOf_iff_forall_dotProduct.mp (inv_mem hg) \u03b6 \u03c9\u2080,\n mem_unitaryGroupOf_iff_forall_dotProduct.mp (inv_mem hg') \u03b6' \u03c9\u2080']\n rw [h\u03bc', star_dotProduct_mulVec_sub_eq h\u03c1, Units.inv_mul_cancel_left]\n -- `g'\u207b\u00b9 \u03b6' = g\u207b\u00b9 \u03b6 - \u03c1 D\u2081` has size `c + 2`.\n have hu' : ((g'\u207b\u00b9 : GL \u03b9 A) : Matrix \u03b9 \u03b9 A) *\u1d65 \u03b6' \u2208 S.vecsOfSize (c + 2) := by\n have h := S.sub_mem_vecsOfSize (lengthLeAt_iff.mp (h\u03b6g.mono (by omega : c \u2264 1 + c)))\n (S.smul_mem_vecsOfSize h\u03c1S hD\u2081)\n simpa [smul_smul] using S.mem_vecsOfSize_of_le h (by omega : 1 + c + 1 \u2264 c + 2)\n have h\u2081 := S.star_dotProduct_mulVec_mem hD\u2081 (lengthLeAt_iff.mp h\u03c9\u2080g)\n have h\u2082 := S.star_dotProduct_mulVec_mem hu' hD\u2082\n exact S.add_mem (i := i + c + t + 5) (S.mem_of_le h\u2081 (by omega)) (S.mem_of_le h\u2082 (by omega))\n\n/-- **The comparison of the lengths descends one step along the flag.** Let `g` and `g'` lie in\nthe unitary group of a Hermitian Gram matrix `J`, let `\u03c1` be a self-adjoint unit of size `1`, and\nlet each `e_b`, `b < a`, be orthogonal to `e_0, \u2026, e_a`. If the class of `e_a` in `Y^(a)` has\ninduced length at most `L ^ c` at `g` and at `g'`, `e_a` has a short dual of exponent `c` for\n`(g, g')` modulo `\u03c1`, and the lengths at `g` and `g'` differ by at most `L ^ t` on `Y^(a + 1)`\nmodulo `\u03c1`, then they differ by at most `L ^ (t + 4c + 12)` on `Y^(a)` modulo `\u03c1`. -/\ntheorem LengthsDifferLe.of_succ (hJ : J.IsHermitian) (hg : g \u2208 unitaryGroupOf J)\n (hg' : g' \u2208 unitaryGroupOf J) (h\u03c1 : IsSelfAdjoint (\u03c1 : A)) (h\u03c1S : (\u03c1 : A) \u2208 S.ofSize 1)\n {a c t : \u2115} (he : \u2200 b < a, \u2200 b' \u2264 a, star (e b) \u2b1d\u1d65 J *\u1d65 e b' = 0)\n (h\u2081 : S.InducedLengthLe e a g c (e a)) (h\u2082 : S.InducedLengthLe e a g' c (e a))\n (hd : S.HasShortDual e a \u03c1 g g' c) (ht : S.LengthsDifferLe e (a + 1) \u03c1 g g' t) :\n S.LengthsDifferLe e a \u03c1 g g' (t + 4 * c + 12) := by\n intro i \u03c9 h\u03c9 h\u03c9g\n rcases isEmpty_or_nonempty \u03b9 with h\u03b9 | h\u03b9\n \u00b7 exact \u27e8\u03c9, by simp, (S.mem_vecsOfSize).mpr fun k => isEmptyElim k\u27e9\n obtain \u27e8e\u2082, he\u2082, he\u2082g'\u27e9 := h\u2082\n obtain \u27e8\u03b6, h\u03b6, h\u03b6a, h\u03b6g, \u03b6', h\u03b6\u03b6', hD\u2081\u27e9 := hd\n -- Split `\u03c9 = \u03c9\u2080 + \u03bb \u03b6` with `\u03bb = \u27e8e_a, \u03c9\u27e9` and `\u03c9\u2080` orthogonal below `a + 1`.\n set lam := star (e a) \u2b1d\u1d65 J *\u1d65 \u03c9\n have hlam : lam \u2208 S.ofSize (c + i + 3) :=\n star_dotProduct_mulVec_mem_of_inducedLengthLe hg h\u2081 h\u03c9 h\u03c9g\n set \u03c9\u2080 := \u03c9 - lam \u2022 \u03b6 with h\u03c9\u2080\n have h\u03c9\u2080g : S.LengthLeAt g (i + 2 * c + 4) \u03c9\u2080 := by\n have h := S.sub_mem_vecsOfSize (lengthLeAt_iff.mp (h\u03c9g.mono (by omega : i \u2264 c + i + 3 + c)))\n (S.smul_mem_vecsOfSize hlam (lengthLeAt_iff.mp h\u03b6g))\n have hexp : c + i + 3 + c + 1 = i + 2 * c + 4 := by omega\n simpa only [lengthLeAt_iff, h\u03c9\u2080, mulVec_sub, mulVec_smul, hexp] using h\n have h\u03c9\u2080orth : \u2200 b < a + 1, star (e b) \u2b1d\u1d65 J *\u1d65 \u03c9\u2080 = 0 := by\n intro b hb\n rcases Nat.lt_succ_iff_lt_or_eq.mp hb with hb | rfl\n \u00b7 simp [h\u03c9\u2080, mulVec_sub, mulVec_smul, dotProduct_sub, dotProduct_smul, h\u03c9 b hb, h\u03b6 b hb]\n \u00b7 simp [h\u03c9\u2080, lam, mulVec_sub, mulVec_smul, dotProduct_sub, dotProduct_smul, h\u03b6a]\n obtain \u27e8\u03c9\u2080', h\u03c9\u2080\u03c9\u2080', hD\u2082\u27e9 := ht (i + 2 * c + 4) \u03c9\u2080 h\u03c9\u2080orth h\u03c9\u2080g\n have hIio : e '' Set.Iio (a + 1) = insert (e a) (e '' Set.Iio a) := by\n rw [\u2190 Set.image_insert_eq, \u2190 Order.succ_eq_add_one, Order.Iio_succ_eq_insert]\n rw [hIio, Submodule.span_insert, Submodule.mem_sup] at h\u03c9\u2080\u03c9\u2080'\n obtain \u27e8y, hy, s, hs, hys\u27e9 := h\u03c9\u2080\u03c9\u2080'\n obtain \u27e8\u03bc, rfl\u27e9 := Submodule.mem_span_singleton.mp hy\n have h\u03bc := inv_mul_mem_of_add_eq_sub hJ hg hg' h\u03c1 h\u03c1S he h\u03b6 h\u03b6a h\u03b6g h\u03b6\u03b6' hD\u2081 h\u03c9\u2080orth h\u03c9\u2080g hD\u2082\n hs hys\n -- The lift `\u03c9' = \u03c9\u2080' + \u03bc e\u2082 + \u03bb \u03b6'`.\n refine \u27e8\u03c9\u2080' + \u03bc \u2022 e\u2082 + lam \u2022 \u03b6', ?_, ?_\u27e9\n \u00b7 have hdiff : \u03c9 - (\u03c9\u2080' + \u03bc \u2022 e\u2082 + lam \u2022 \u03b6') = s + \u03bc \u2022 (e a - e\u2082) + lam \u2022 (\u03b6 - \u03b6') := by\n rw [eq_sub_of_add_eq' hys, h\u03c9\u2080]\n module\n rw [hdiff]\n exact Submodule.add_mem _ (Submodule.add_mem _ hs (Submodule.smul_mem _ _ he\u2082))\n (Submodule.smul_mem _ _ h\u03b6\u03b6')\n \u00b7 set G : Matrix \u03b9 \u03b9 A := ((g\u207b\u00b9 : GL \u03b9 A) : Matrix \u03b9 \u03b9 A)\n set G' : Matrix \u03b9 \u03b9 A := ((g'\u207b\u00b9 : GL \u03b9 A) : Matrix \u03b9 \u03b9 A)\n set r : A := ((\u03c1\u207b\u00b9 : A\u02e3) : A)\n have hdiff : r \u2022 (G *\u1d65 \u03c9 - G' *\u1d65 (\u03c9\u2080' + \u03bc \u2022 e\u2082 + lam \u2022 \u03b6')) =\n r \u2022 (G *\u1d65 \u03c9\u2080 - G' *\u1d65 \u03c9\u2080') - (r * \u03bc) \u2022 (G' *\u1d65 e\u2082) + lam \u2022 (r \u2022 (G *\u1d65 \u03b6 - G' *\u1d65 \u03b6')) := by\n rw [h\u03c9\u2080]\n simp only [mulVec_add, mulVec_sub, mulVec_smul]\n module\n rw [hdiff]\n have hsub := S.sub_mem_vecsOfSize (S.mem_vecsOfSize_of_le hD\u2082 (by omega))\n (S.smul_mem_vecsOfSize h\u03bc (lengthLeAt_iff.mp he\u2082g'))\n exact S.mem_vecsOfSize_of_le (S.add_mem_vecsOfSize hsub\n (S.mem_vecsOfSize_of_le (S.smul_mem_vecsOfSize hlam hD\u2081) (by omega))) (by omega)\n\n/-- **The comparison of the lengths on the whole space.** Let `g` and `g'` lie in the unitary\ngroup of a Hermitian Gram matrix `J`, let `\u03c1` be a self-adjoint unit of size `1`, and let\n`\u27e8e_b, e_b'\u27e9 = 0` for all `b, b' < j` (each `e_b` is isotropic as well as orthogonal to the\nothers). If, for every `a < j`, the class of `e_a` in `Y^(a)` has induced length at most `L ^ c`\nat `g` and at `g'` and `e_a` has a short dual of exponent `c` for `(g, g')` modulo `\u03c1`, and the\nlengths at `g` and `g'` differ by at most `L ^ t` on `Y^(j)` modulo `\u03c1`, then they differ by at\nmost `L ^ (t + (4c + 12) j)` on the whole space `Y^(0)` modulo `\u03c1`. -/\ntheorem LengthsDifferLe.zero_of_hasShortDual (hJ : J.IsHermitian) (hg : g \u2208 unitaryGroupOf J)\n (hg' : g' \u2208 unitaryGroupOf J) (h\u03c1 : IsSelfAdjoint (\u03c1 : A)) (h\u03c1S : (\u03c1 : A) \u2208 S.ofSize 1)\n {j c t : \u2115} (he : \u2200 b < j, \u2200 b' < j, star (e b) \u2b1d\u1d65 J *\u1d65 e b' = 0)\n (h : \u2200 a < j, S.InducedLengthLe e a g c (e a) \u2227 S.InducedLengthLe e a g' c (e a) \u2227\n S.HasShortDual e a \u03c1 g g' c)\n (ht : S.LengthsDifferLe e j \u03c1 g g' t) :\n S.LengthsDifferLe e 0 \u03c1 g g' (t + (4 * c + 12) * j) := by\n induction j generalizing t with\n | zero => simpa using ht\n | succ j ih =>\n obtain \u27e8h\u2081, h\u2082, hd\u27e9 := h j (Nat.lt_succ_self j)\n have hj := ht.of_succ hJ hg hg' h\u03c1 h\u03c1S\n (fun b hb b' hb' => he b (by omega) b' (by omega)) h\u2081 h\u2082 hd\n have := ih (fun b hb b' hb' => he b (by omega) b' (by omega))\n (fun a ha => h a (by omega)) hj\n have hexp : t + 4 * c + 12 + (4 * c + 12) * j = t + (4 * c + 12) * (j + 1) := by ring\n rwa [hexp] at this\n\n", "statement": "/-- **Points with comparable lengths are close.** If `x` lies in the unitary group of an\ninvertible Gram matrix `J`, `\u03c1` is a self-adjoint unit, and the lengths at `g` and `g x` differ by\nat most `L ^ i` on the whole space `Y^(0)` modulo `\u03c1`, then `(x - 1) / \u03c1` has size `i + 4`. -/\ntheorem LengthsDifferLe.smul_sub_one_mem_matsOfSize (hJ : IsUnit J) {x : GL \u03b9 A}\n (hx : x \u2208 unitaryGroupOf J) (h\u03c1 : IsSelfAdjoint (\u03c1 : A)) {i : \u2115}\n (h : S.LengthsDifferLe e 0 \u03c1 g (g * x) i) :\n ((\u03c1\u207b\u00b9 : A\u02e3) : A) \u2022 ((x : Matrix \u03b9 \u03b9 A) - 1) \u2208 S.matsOfSize (i + 4) ", "proof": " by\n set r : A := ((\u03c1\u207b\u00b9 : A\u02e3) : A) with hr\n set M : Matrix \u03b9 \u03b9 A := r \u2022 (1 - ((x\u207b\u00b9 : GL \u03b9 A) : Matrix \u03b9 \u03b9 A)) with hM\n -- The columns of `(1 - x\u207b\u00b9) / \u03c1` are the differences at `g` and `g x` of the vectors `g e_k`.\n have hMS : M \u2208 S.matsOfSize i := by\n refine S.mem_matsOfSize_of_col fun k => ?_\n obtain \u27e8\u03c9', h\u03c9', hk\u27e9 := h 0 ((g : Matrix \u03b9 \u03b9 A) *\u1d65 Pi.single k 1) (fun b hb => absurd hb\n (Nat.not_lt_zero b)) (by\n rw [lengthLeAt_iff, mulVec_mulVec, Units.inv_mul, one_mulVec]\n exact S.single_one_mem_vecsOfSize 0 k)\n have h\u03c9'eq : \u03c9' = (g : Matrix \u03b9 \u03b9 A) *\u1d65 Pi.single k 1 := by\n simpa [sub_eq_zero, eq_comm] using h\u03c9'\n have hgx : (((g * x)\u207b\u00b9 : GL \u03b9 A) : Matrix \u03b9 \u03b9 A) * g = ((x\u207b\u00b9 : GL \u03b9 A) : Matrix \u03b9 \u03b9 A) := by\n rw [\u2190 Units.val_mul, _root_.mul_inv_rev, inv_mul_cancel_right]\n simp only [h\u03c9'eq, zero_add, mulVec_mulVec, Units.inv_mul, hgx, one_mulVec] at hk\n convert hk using 1\n ext a\n simp [hM, hr, Matrix.one_apply, Pi.single_apply]\n -- `x = J\u207b\u00b9 * star x\u207b\u00b9 * J`, so that `(x - 1) / \u03c1 = -(J\u207b\u00b9 * M\u1d34 * J)`.\n have hxJ : (x : Matrix \u03b9 \u03b9 A) = J\u207b\u00b9 * star ((x\u207b\u00b9 : GL \u03b9 A) : Matrix \u03b9 \u03b9 A) * J := by\n rw [\u2190 val_inv_of_mem_unitaryGroupOf hJ (inv_mem hx), inv_inv]\n have h\u03c1' : star r = r := (h\u03c1.of_mul_eq_one (Units.mul_inv \u03c1)).star_eq\n have hJJ : J\u207b\u00b9 * J = 1 := nonsing_inv_mul J ((isUnit_iff_isUnit_det J).mp hJ)\n have hkey : r \u2022 ((x : Matrix \u03b9 \u03b9 A) - 1) = -(J\u207b\u00b9 * M\u1d34 * J) := by\n rw [hxJ]\n simp [hM, h\u03c1', Matrix.mul_sub, Matrix.sub_mul, hJJ, star_eq_conjTranspose, smul_sub]\n rw [hkey, neg_mem_matsOfSize_iff]\n have h\u2081 := S.mul_mem_matsOfSize S.gram_inv_mem_matsOfSize\n ((S.conjTranspose_mem_matsOfSize_iff).mpr hMS)\n have h\u2082 := S.mul_mem_matsOfSize h\u2081 S.gram_mem_matsOfSize\n exact S.mem_matsOfSize_of_le h\u2082 (by omega)", "proof_lines": 30, "proof_length": 1511, "rev": "75c8aed5fea63047615a25a9763fd5b68a86e891", "heartbeats": 3786, "image": "lean-compression:tauceti-75c8aed5fe-a608030cfc", "split": "dev"} {"path": "TauCeti/Analysis/Hyperfunction/OneDimensional.lean", "module": "TauCeti.Analysis.Hyperfunction.OneDimensional", "theorem": "TauCeti.Hyperfunction.throughReal_iSup", "prefix": "/-\nCopyright (c) 2026 The Tau Ceti contributors. All rights reserved.\nReleased under Apache 2.0 license as described in the file LICENSE.\nAuthors: The Tau Ceti contributors\n-/\nmodule\n\npublic import Mathlib.Algebra.Category.ModuleCat.Basic\npublic import Mathlib.Analysis.Calculus.FDeriv.Add\npublic import Mathlib.Analysis.Complex.Basic\npublic import Mathlib.CategoryTheory.Sites.Sheaf\npublic import Mathlib.CategoryTheory.Sites.Spaces\npublic import Mathlib.LinearAlgebra.Quotient.Basic\npublic import Mathlib.Topology.Sheaves.Presheaf\nimport Mathlib.Analysis.Complex.ReImTopology\nimport Mathlib.Topology.Separation.Regular\n\n/-!\n# One-dimensional hyperfunctions as boundary values of holomorphic functions\n\nIn one variable, Sato's hyperfunctions on an open set `U \u2286 \u211d` can be written as differences of\nboundary values of holomorphic functions. Put `W(U) = \u2102 \u2216 (\u211d \u2216 U)`, the largest open subset of\n`\u2102` whose intersection with `\u211d` is `U`. A hyperfunction on `U` is represented by\na holomorphic function `f` on `\u2102 \u2216 \u211d`, that is, by a pair of holomorphic functions on the upper\nand the lower half-plane, and two representatives give the same hyperfunction when their\ndifference extends holomorphically across `U`, i.e. to all of `W(U)`. The space of hyperfunctions\non `U` is the quotient `O(\u2102 \u2216 \u211d) / O(W(U))`. Restriction to a smaller open `V \u2286 U` keeps the\nrepresentative: a function extending across `U` also extends across `V`.\n\n## Encoding\n\nHolomorphic functions on an open `U \u2286 \u2102` are encoded as genuine functions `\u2102 \u2192 \u2102` that are\ncomplex differentiable on `U` and vanish outside `U`\n(`TauCeti.Hyperfunction.holomorphicSections`). The extension by zero is only a device for using\none ambient module of functions; no continuity across the boundary of `U` is imposed or used.\nRestriction to a smaller open multiplies by the indicator function\n(`TauCeti.Hyperfunction.holomorphicRestrict`). A section over `U` is a restriction from `V \u2287 U`\nexactly when it agrees on `U` with a section over `V`\n(`TauCeti.Hyperfunction.mem_range_holomorphicRestrict_iff`).\n\n## Main declarations\n\n* `TauCeti.Hyperfunction.nonRealOpen`: the open set `\u2102 \u2216 \u211d`, which is dense\n (`TauCeti.Hyperfunction.dense_nonRealOpen`);\n* `TauCeti.Hyperfunction.complexNeighborhood U`: the open set `W(U) = \u2102 \u2216 (\u211d \u2216 U)`;\n* `TauCeti.Hyperfunction.realAxis`: the real axis as a closed subset of `\u2102`, whose complement is\n `\u2102 \u2216 \u211d` (`TauCeti.Hyperfunction.compl_realAxis`);\n* `TauCeti.Hyperfunction.throughReal U`: the holomorphic functions on `\u2102 \u2216 \u211d` that extend\n holomorphically to `W(U)`;\n* `TauCeti.Hyperfunction.OneDimBoundaryQuotient U`: the quotient `O(\u2102 \u2216 \u211d) / O(W(U))`, and\n `TauCeti.Hyperfunction.oneDimBoundaryPresheaf` the presheaf of complex vector spaces\n `U \u21a6 O(\u2102 \u2216 \u211d) / O(W(U))` on `\u211d`. All its restriction maps are surjective\n (`TauCeti.Hyperfunction.oneDimBoundaryRestrict_surjective`).\n\n## Main results\n\n* `TauCeti.Hyperfunction.throughReal_iSup`: a holomorphic function on `\u2102 \u2216 \u211d` extends across\n `\u22c3 i, U i` exactly when it extends across every `U i`. The local extensions agree on the real\n points of the overlaps, because they are continuous there and agree on the dense set `\u2102 \u2216 \u211d`, so\n they glue.\n* `TauCeti.Hyperfunction.oneDimBoundaryPresheaf_isSeparated`: consequently the presheaf\n `U \u21a6 O(\u2102 \u2216 \u211d) / O(W(U))` is separated: a section that vanishes locally vanishes. This is the\n uniqueness half of the sheaf property. The existence half needs the vanishing of the first\n cohomology of the sheaf of holomorphic functions on open subsets of `\u2102` (a Cousin problem) and is\n not proved here.\n* `TauCeti.Hyperfunction.eq_of_forall_oneDimBoundaryRestrict_eq`: a one-dimensional hyperfunction\n on `U` is determined by its restrictions to the open sets whose closure is a compact subset\n of `U`.\n\n## References\n\n* M. Sato, *Theory of hyperfunctions I*, J. Fac. Sci. Univ. Tokyo Sect. I 8 (1959), 139\u2013193.\n* H. Komatsu, *An introduction to the theory of hyperfunctions*, in *Hyperfunctions and\n pseudo-differential equations*, Lecture Notes in Mathematics 287 (1973), 3\u201340.\n* L. H\u00f6rmander, *The analysis of linear partial differential operators I*, \u00a79.1.\n-/\n\npublic section\n\nnoncomputable section\n\nopen CategoryTheory Opposite Set TopologicalSpace\n\nnamespace TauCeti.Hyperfunction\n\n/-! ### Holomorphic sections -/\n\n/-- The holomorphic functions on an open set `U \u2286 \u2102`, encoded as the functions `\u2102 \u2192 \u2102` that are\ncomplex differentiable on `U` and vanish outside `U`. -/\ndef holomorphicSections (U : Opens \u2102) : Submodule \u2102 (\u2102 \u2192 \u2102) where\n carrier := {f | DifferentiableOn \u2102 f U \u2227 \u2200 z, z \u2209 U \u2192 f z = 0}\n zero_mem' := \u27e8differentiableOn_const 0, fun _ _ => rfl\u27e9\n add_mem' hf hg :=\n \u27e8hf.1.add hg.1, fun z hz => by simp [hf.2 z hz, hg.2 z hz]\u27e9\n smul_mem' c _ hf :=\n \u27e8hf.1.const_smul c, fun z hz => by simp [hf.2 z hz]\u27e9\n\ntheorem mem_holomorphicSections_iff {U : Opens \u2102} {f : \u2102 \u2192 \u2102} :\n f \u2208 holomorphicSections U \u2194 DifferentiableOn \u2102 f U \u2227 \u2200 z, z \u2209 U \u2192 f z = 0 :=\n Iff.rfl\n\n/-- The indicator function of `U` turns a function holomorphic on `U` into a holomorphic section\nover `U`. -/\ntheorem indicator_mem_holomorphicSections_of_differentiableOn {U : Opens \u2102} {f : \u2102 \u2192 \u2102}\n (hf : DifferentiableOn \u2102 f U) : (U : Set \u2102).indicator f \u2208 holomorphicSections U :=\n \u27e8hf.congr fun _ hz => indicator_of_mem hz f, fun _ hz => indicator_of_notMem hz f\u27e9\n\n/-- The indicator function of a smaller open set restricts holomorphic sections. -/\ntheorem indicator_mem_holomorphicSections {U V : Opens \u2102} (h : U \u2264 V) {f : \u2102 \u2192 \u2102}\n (hf : f \u2208 holomorphicSections V) : (U : Set \u2102).indicator f \u2208 holomorphicSections U :=\n indicator_mem_holomorphicSections_of_differentiableOn (hf.1.mono h)\n\n/-- Restriction of holomorphic sections to a smaller open set. -/\ndef holomorphicRestrict {U V : Opens \u2102} (h : U \u2264 V) :\n holomorphicSections V \u2192\u2097[\u2102] holomorphicSections U where\n toFun f := \u27e8(U : Set \u2102).indicator f, indicator_mem_holomorphicSections h f.property\u27e9\n map_add' f g := Subtype.ext <| funext fun z => by by_cases hz : z \u2208 U <;> simp [hz]\n map_smul' c f := Subtype.ext <| funext fun z => by by_cases hz : z \u2208 U <;> simp [hz]\n\n@[simp]\ntheorem coe_holomorphicRestrict {U V : Opens \u2102} (h : U \u2264 V) (f : holomorphicSections V) :\n (holomorphicRestrict h f : \u2102 \u2192 \u2102) = (U : Set \u2102).indicator f :=\n (rfl)\n\n/-- The restriction to `U` agrees with the section at points of `U`. -/\ntheorem holomorphicRestrict_apply_of_mem {U V : Opens \u2102} (h : U \u2264 V) (f : holomorphicSections V)\n {z : \u2102} (hz : z \u2208 U) : (holomorphicRestrict h f : \u2102 \u2192 \u2102) z = (f : \u2102 \u2192 \u2102) z :=\n indicator_of_mem hz (f : \u2102 \u2192 \u2102)\n\n/-- The restriction to `U` vanishes at points outside `U`. -/\ntheorem holomorphicRestrict_apply_of_notMem {U V : Opens \u2102} (h : U \u2264 V)\n (f : holomorphicSections V) {z : \u2102} (hz : z \u2209 U) : (holomorphicRestrict h f : \u2102 \u2192 \u2102) z = 0 :=\n indicator_of_notMem hz (f : \u2102 \u2192 \u2102)\n\n@[simp]\ntheorem holomorphicRestrict_self (U : Opens \u2102) (f : holomorphicSections U) :\n holomorphicRestrict le_rfl f = f :=\n Subtype.ext <| (coe_holomorphicRestrict _ f).trans <|\n indicator_eq_self.mpr <| Function.support_subset_iff'.mpr f.property.2\n\n@[simp]\ntheorem holomorphicRestrict_holomorphicRestrict {U V W : Opens \u2102} (h\u2081 : U \u2264 V) (h\u2082 : V \u2264 W)\n (f : holomorphicSections W) :\n holomorphicRestrict h\u2081 (holomorphicRestrict h\u2082 f) = holomorphicRestrict (h\u2081.trans h\u2082) f :=\n Subtype.ext <| by\n simp [indicator_indicator, inter_eq_left.mpr (SetLike.coe_subset_coe.mpr h\u2081)]\n\n/-- A holomorphic section over `U` is the restriction of a holomorphic section over `V \u2287 U`\nexactly when it agrees on `U` with a holomorphic section over `V`. -/\ntheorem mem_range_holomorphicRestrict_iff {U V : Opens \u2102} (h : U \u2264 V)\n {f : holomorphicSections U} :\n f \u2208 LinearMap.range (holomorphicRestrict h) \u2194 \u2203 g \u2208 holomorphicSections V, EqOn g f U := by\n refine \u27e8fun \u27e8g, hg\u27e9 => \u27e8g, g.property, fun z hz => ?_\u27e9, fun \u27e8g, hg, hgf\u27e9 => \u27e8\u27e8g, hg\u27e9, ?_\u27e9\u27e9\n \u00b7 rw [\u2190 hg, holomorphicRestrict_apply_of_mem h g hz]\n \u00b7 refine Subtype.ext (funext fun z => ?_)\n by_cases hz : z \u2208 U\n \u00b7 exact (holomorphicRestrict_apply_of_mem h _ hz).trans (hgf hz)\n \u00b7 exact (holomorphicRestrict_apply_of_notMem h _ hz).trans (f.property.2 z hz).symm\n\n/-- Restriction along a commuting square of inclusions `U' \u2264 U`, `V' \u2264 V`, `U \u2264 V`, `U' \u2264 V'`\nmaps the restrictions from `V` to `U` into the restrictions from `V'` to `U'`. -/\ntheorem range_holomorphicRestrict_le_comap {U U' V V' : Opens \u2102} (hUV : U \u2264 V) (hUV' : U' \u2264 V')\n (hU : U' \u2264 U) (hV : V' \u2264 V) :\n LinearMap.range (holomorphicRestrict hUV) \u2264\n (LinearMap.range (holomorphicRestrict hUV')).comap (holomorphicRestrict hU) := by\n rintro _ \u27e8g, rfl\u27e9\n exact \u27e8holomorphicRestrict hV g, by simp only [holomorphicRestrict_holomorphicRestrict]\u27e9\n\n/-! ### The open sets `\u2102 \u2216 \u211d` and `W(U)` -/\n\n/-- The open set `\u2102 \u2216 \u211d`, the union of the upper and the lower half-plane. -/\ndef nonRealOpen : Opens \u2102 :=\n \u27e8{z | z.im \u2260 0}, isOpen_ne_fun Complex.continuous_im continuous_const\u27e9\n\n@[simp]\ntheorem mem_nonRealOpen_iff {z : \u2102} : z \u2208 nonRealOpen \u2194 z.im \u2260 0 :=\n Iff.rfl\n\n/-- The non-real complex numbers are dense in `\u2102`. -/\ntheorem dense_nonRealOpen : Dense (nonRealOpen : Set \u2102) :=\n (dense_compl_singleton (0 : \u211d)).preimage Complex.isOpenMap_im\n\n/-- The open set `W(U) = \u2102 \u2216 (\u211d \u2216 U)` attached to an open set `U \u2286 \u211d`: the non-real complex\nnumbers together with the points of `U`. -/\ndef complexNeighborhood (U : Opens \u211d) : Opens \u2102 :=\n nonRealOpen \u2294 \u27e8Complex.re \u207b\u00b9' U, U.isOpen.preimage Complex.continuous_re\u27e9\n\n@[simp]\ntheorem mem_complexNeighborhood_iff {U : Opens \u211d} {z : \u2102} :\n z \u2208 complexNeighborhood U \u2194 z.im \u2260 0 \u2228 z.re \u2208 U :=\n Iff.rfl\n\n/-- The set `W(U)` contains `\u2102 \u2216 \u211d`. -/\ntheorem nonRealOpen_le_complexNeighborhood (U : Opens \u211d) :\n nonRealOpen \u2264 complexNeighborhood U :=\n le_sup_left\n\n/-- The set `W(U)` grows with `U`. -/\ntheorem complexNeighborhood_mono : Monotone complexNeighborhood := fun _ _ h =>\n sup_le_sup_left (fun _ hz => h hz) _\n\n/-- The real axis `{z | z.im = 0}`, as a closed subset of `\u2102`. -/\ndef realAxis : Closeds \u2102 :=\n \u27e8{z | z.im = 0}, isClosed_eq Complex.continuous_im continuous_const\u27e9\n\n@[simp]\ntheorem mem_realAxis_iff {z : \u2102} : z \u2208 realAxis \u2194 z.im = 0 :=\n Iff.rfl\n\n/-- The complement of the real axis is `\u2102 \u2216 \u211d`. -/\ntheorem compl_realAxis : realAxis.compl = nonRealOpen := by\n ext z\n simp [Closeds.compl]\n\n/-- Removing the real axis from `W(U) = \u2102 \u2216 (\u211d \u2216 U)` leaves `\u2102 \u2216 \u211d`. -/\ntheorem complexNeighborhood_inf_compl_realAxis (U : Opens \u211d) :\n complexNeighborhood U \u2293 realAxis.compl = nonRealOpen := by\n rw [compl_realAxis]\n exact inf_eq_right.2 (nonRealOpen_le_complexNeighborhood U)\n\n/-! ### Functions extending across a real open set -/\n\n/-- The holomorphic functions on `\u2102 \u2216 \u211d` that extend holomorphically across the open set\n`U \u2286 \u211d`, that is, that are restrictions of holomorphic functions on `W(U)`. -/\ndef throughReal (U : Opens \u211d) : Submodule \u2102 (holomorphicSections nonRealOpen) :=\n LinearMap.range (holomorphicRestrict (nonRealOpen_le_complexNeighborhood U))\n\n/-- A holomorphic function on `\u2102 \u2216 \u211d` extends across `U` exactly when it agrees on `\u2102 \u2216 \u211d` with\na holomorphic function on `W(U)`. -/\ntheorem mem_throughReal_iff {U : Opens \u211d} {f : holomorphicSections nonRealOpen} :\n f \u2208 throughReal U \u2194\n \u2203 g \u2208 holomorphicSections (complexNeighborhood U), EqOn g f nonRealOpen :=\n mem_range_holomorphicRestrict_iff _\n\n/-- A function extending across `V` extends across every smaller `U`. -/\ntheorem throughReal_antitone : Antitone throughReal := fun _ _ h f hf => by\n have := range_holomorphicRestrict_le_comap _ (nonRealOpen_le_complexNeighborhood _) le_rfl\n (complexNeighborhood_mono h) hf\n rwa [Submodule.mem_comap, holomorphicRestrict_self] at this\n\n/-- Two functions continuous on open sets containing `\u2102 \u2216 \u211d` that agree on `\u2102 \u2216 \u211d` agree on the\nintersection of the two open sets: the real points there are limits of non-real ones. -/\ntheorem eqOn_inf_of_eqOn_nonRealOpen {V\u2081 V\u2082 : Opens \u2102} {g\u2081 g\u2082 : \u2102 \u2192 \u2102}\n (h\u2081 : ContinuousOn g\u2081 V\u2081) (h\u2082 : ContinuousOn g\u2082 V\u2082) (hV\u2081 : nonRealOpen \u2264 V\u2081)\n (hV\u2082 : nonRealOpen \u2264 V\u2082) (h : EqOn g\u2081 g\u2082 nonRealOpen) : EqOn g\u2081 g\u2082 (V\u2081 \u2293 V\u2082 : Opens \u2102) :=\n h.of_subset_closure (h\u2081.mono inter_subset_left) (h\u2082.mono inter_subset_right)\n (subset_inter hV\u2081 hV\u2082) (by simp [dense_nonRealOpen.closure_eq])\n\n", "statement": "/-- **Extension across a union.** A holomorphic function on `\u2102 \u2216 \u211d` extends holomorphically\nacross `\u22c3 i, U i` exactly when it extends holomorphically across every `U i`. -/\ntheorem throughReal_iSup {\u03b9 : Sort*} (U : \u03b9 \u2192 Opens \u211d) :\n throughReal (\u2a06 i, U i) = \u2a05 i, throughReal (U i) ", "proof": " by\n classical\n refine le_antisymm (le_iInf fun i => throughReal_antitone (le_iSup U i)) fun f hf => ?_\n rw [Submodule.mem_iInf] at hf\n choose g hg hgf using fun i => mem_throughReal_iff.mp (hf i)\n -- The glued function: `f` off the real line, and the extension `g i` at a real point of `U i`.\n let G : \u2102 \u2192 \u2102 := fun z =>\n if z.im = 0 then (if h : \u2203 i, z.re \u2208 U i then g h.choose z else 0) else (f : \u2102 \u2192 \u2102) z\n -- Off the real line, the glued function is `f`.\n have hGf : EqOn G f nonRealOpen := fun z hz => by simp [G, mem_nonRealOpen_iff.mp hz]\n -- On `W(U i)`, the glued function is the extension `g i`.\n have hG : \u2200 i, EqOn G (g i) (complexNeighborhood (U i)) := by\n intro i z hz\n by_cases him : z.im = 0\n \u00b7 have hex : \u2203 j, z.re \u2208 U j :=\n \u27e8i, (mem_complexNeighborhood_iff.mp hz).resolve_left fun h => h him\u27e9\n simp only [G, him, hex, ite_true, dite_true]\n refine eqOn_inf_of_eqOn_nonRealOpen (hg _).1.continuousOn (hg i).1.continuousOn\n (nonRealOpen_le_complexNeighborhood _) (nonRealOpen_le_complexNeighborhood _)\n (fun w hw => (hgf _ hw).trans (hgf i hw).symm) \u27e8Or.inr hex.choose_spec, hz\u27e9\n \u00b7 exact (hGf him).trans (hgf i him).symm\n refine mem_throughReal_iff.mpr \u27e8G, \u27e8fun z hz => ?_, fun z hz => ?_\u27e9, hGf\u27e9\n \u00b7 rcases mem_complexNeighborhood_iff.mp hz with him | hre\n \u00b7 exact ((f.property.1.congr hGf).differentiableAt\n (nonRealOpen.isOpen.mem_nhds him)).differentiableWithinAt\n \u00b7 obtain \u27e8i, hi\u27e9 := Opens.mem_iSup.mp hre\n exact (((hg i).1.congr (hG i)).differentiableAt\n ((complexNeighborhood (U i)).isOpen.mem_nhds (Or.inr hi))).differentiableWithinAt\n \u00b7 simp only [mem_complexNeighborhood_iff, Opens.mem_iSup, not_or, not_not, not_exists] at hz\n simp [G, hz]", "proof_lines": 29, "proof_length": 1428, "rev": "75c8aed5fea63047615a25a9763fd5b68a86e891", "heartbeats": 894, "image": "lean-compression:tauceti-75c8aed5fe-a608030cfc", "split": "dev"} {"path": "TauCeti/Geometry/Manifold/Morse/Boundary/Broken/End.lean", "module": "TauCeti.Geometry.Manifold.Morse.Boundary.Broken.End", "theorem": "TauCeti.IsAdaptedPseudoGradient.tendsto_atTop_of_tendsto_morseTrajectoryPairs", "prefix": "/-\nCopyright (c) 2026 The Tau Ceti contributors. All rights reserved.\nReleased under Apache 2.0 license as described in the file LICENSE.\nAuthors: The Tau Ceti contributors\n-/\nmodule\n\npublic import TauCeti.Geometry.Manifold.Morse.Boundary.Broken.Direction\npublic import TauCeti.Geometry.Manifold.Morse.Boundary.Compactification\nimport TauCeti.Dynamics.Flow.Basic\n\n/-!\n# The broken ends of the compactified space of index-two trajectories\n\nLet `X` be a pseudo-gradient adapted to a Morse function `f` on a compact manifold, and let\n`p`, `r` be critical points. The trajectories from `p` to `r` are recorded by their pairs of points\n`(y, z)` on two levels `c\u2081 > c\u2082` (`TauCeti.IsAdaptedPseudoGradient.morseTrajectoryPairs`), and\nwhen `ind p = ind r + 2` the closure of these pairs adds the trajectories broken once, at a\ncritical point `q` of intermediate index: the pairs `x = (x\u2081, x\u2082)` with `x\u2081` on a trajectory from\n`p` to `q` and `x\u2082` on a trajectory from `q` to `r`\n(`TauCeti.IsAdaptedPseudoGradient.morseBrokenTrajectoryPairs`). This file describes the unbroken\npairs near such a broken end `x`, in the form needed to compare the orientation of the arcs of the\ncompactified space with the signs of broken trajectories.\n\n* **The crossing times diverge.** The time `T` taking the first point of an unbroken pair to its\n second point, which is positive since `f` decreases along the flow, tends to `+\u221e` as the pairs\n tend to `x` (`tendsto_atTop_of_tendsto_morseTrajectoryPairs`): no time takes `x\u2081 \u2208 W^s(q)` to\n `x\u2082 \u2208 W^s(r)`, so by `Flow.tendsto_abs_atTop_of_forall_apply_ne` the times cannot stay bounded.\n These are the times along which the nearby orbits cross the Morse chart of `q` linearly, as in\n `TauCeti.IsAdaptedPseudoGradient.eventually_forall_linearFlow_mem_target_of_broken`.\n* **The comparison maps converge.** For Morse charts `\u03c6p`, `\u03c6q`, `\u03c6r` in which `X` is linear, the\n comparison maps `C_{pr}(y)` of the unbroken pairs `(y, z)` tend to `(id \u00d7 B\u2082) \u2218 C_{pq}(x\u2081)`, where\n `B\u2082` is the second component of `C_{qr}(x\u2082)`\n (`tendsto_trajectoryComparison_of_tendsto_morseTrajectoryPairs`). Their kernels are the tangent\n lines of the arc of unbroken trajectories, and the kernel of the limit is the line spanned by the\n gluing direction (`TauCeti.LinearAlgebra.Orientation.Breaking`).\n* **The broken end is a strict local minimum of the leaving coordinate.** Let `a` be a time of\n linear forward flow of `x\u2081` in the chart `\u03c6q`, and `\u2113` a linear form positive on the direction in\n which `x\u2082` leaves `q`. The function `h (y, z) = \u2113 (N(\u03c6q (\u03a6_a y)))`, which reads the coordinates\n `N` of negative weight in `\u03c6q`, vanishes at `x`, since `x\u2081 \u2208 W^s(q)`\n (`TauCeti.IsAdaptedPseudoGradient.negativeCoord_toChart_flow_eq_zero_of_mem_stableSet`), and is\n positive at the unbroken pairs near `x`\n (`eventually_pos_negativeCoord_toChart_flow_of_tendsto_morseTrajectoryPairs`). Under the\n Morse\u2013Smale condition, near `x` the compactified space consists of `x` and unbroken pairs, so `h`\n is positive on the compactified space near `x` away from `x`\n (`IsMorseSmale.eventually_pos_negativeCoord_toChart_flow_nhdsWithin_closure`). Along the gluing\n direction `h` decreases\n (`apply_negativeCoord_mfderiv_unstableFrame_lt_zero_of_trajectoryComparison_eq`),\n so this direction points out of the compactified space at its broken end.\n\n## Main results\n\nIn the namespace `TauCeti.IsAdaptedPseudoGradient`:\n\n* `tendsto_atTop_of_tendsto_morseTrajectoryPairs`: the crossing times of unbroken pairs tending\n to a broken end tend to `+\u221e`.\n* `exists_tendsto_atTop_tendsto_flow_of_tendsto_morseTrajectoryPairs`: such pairs have crossing\n times tending to `+\u221e` along which their first points flow to their second points, as the\n broken-trajectory limit theorems require.\n* `tendsto_trajectoryComparison_of_tendsto_morseTrajectoryPairs`: their comparison maps converge.\n* `eventually_pos_negativeCoord_toChart_flow_of_tendsto_morseTrajectoryPairs`: they lie on the\n positive side of the leaving coordinate.\n* `IsMorseSmale.eventually_pos_negativeCoord_toChart_flow_nhdsWithin_closure`: the broken end is a\n strict local minimum of the leaving coordinate on the compactified space.\n\n## References\n\n* M. Hutchings, *Lecture notes on Morse homology (with an eye towards Floer theory and\n pseudoholomorphic curves)*, 2002, \u00a72.3 (the boundary of the compactified space of index-two\n trajectories and its orientation at the broken trajectories).\n* M. Audin and M. Damian, *Morse Theory and Floer Homology*, Springer Universitext, 2014,\n Chapter 3 (the compactified space of index-two trajectories as a manifold with boundary).\n-/\n\npublic section\n\nopen Filter Set Topology\nopen scoped ContDiff Manifold\n\nnamespace TauCeti\n\nvariable {E : Type*} [NormedAddCommGroup E] [NormedSpace \u211d E] [FiniteDimensional \u211d E]\n {M : Type*} [TopologicalSpace M] [ChartedSpace E M] [IsManifold \ud835\udcd8(\u211d, E) \u221e M]\n [CompactSpace M] [T2Space M]\n {f : M \u2192 \u211d} {X : (x : M) \u2192 TangentSpace \ud835\udcd8(\u211d, E) x}\n\nnamespace IsAdaptedPseudoGradient\n\nvariable {hX : IsAdaptedPseudoGradient f X} {p q r : M} {c\u2081 c\u2082 : \u211d}\n\n/-! ### Crossing times -/\n\n", "statement": "/-- **The crossing times diverge at a broken end.** Let unbroken pairs `w n` on the levels\n`c\u2081 > c\u2082` tend to a pair `x` whose first point lies in `W^s(q)` and whose second point lies in\n`W^s(r)`, for `q \u2260 r`, as the broken trajectory pairs through `q` do. Then the times `T n` taking\nthe first point of `w n` to its second point tend to `+\u221e`. -/\ntheorem tendsto_atTop_of_tendsto_morseTrajectoryPairs (h\u2082\u2081 : c\u2082 < c\u2081) {x : M \u00d7 M}\n (hx\u2081 : x.1 \u2208 hX.flow.stableSet q) (hx\u2082 : x.2 \u2208 hX.flow.stableSet r) (hqr : q \u2260 r)\n {\u03b9 : Type*} {l : Filter \u03b9} {w : \u03b9 \u2192 M \u00d7 M} {T : \u03b9 \u2192 \u211d} (hw : Tendsto w l (\ud835\udcdd x))\n (hwP : \u2200\u1da0 n in l, w n \u2208 hX.morseTrajectoryPairs p r c\u2081 c\u2082)\n (hT : \u2200\u1da0 n in l, hX.flow (T n) (w n).1 = (w n).2) :\n Tendsto T l atTop ", "proof": " by\n -- No time takes `x\u2081 \u2208 W^s(q)` to `x\u2082 \u2208 W^s(r)`, so the times are unbounded.\n have hne : \u2200 t, hX.flow t x.1 \u2260 x.2 := fun t ht \u21a6\n (Flow.disjoint_stableSet hqr).notMem_of_mem_left\n ((Flow.apply_mem_stableSet_iff hX.flow t).2 hx\u2081) (ht \u25b8 hx\u2082)\n have habs := hX.flow.tendsto_abs_atTop_of_forall_apply_ne hne\n ((continuous_fst.tendsto x).comp hw)\n (((continuous_snd.tendsto x).comp hw).congr' (hT.mono fun _ hn \u21a6 hn.symm))\n -- The times are positive, since `f` decreases along the flow from the level `c\u2081` to `c\u2082`.\n refine habs.congr' ((hwP.and hT).mono fun n \u27e8hn, hTn\u27e9 \u21a6 abs_of_pos ?_)\n obtain \u27e8-, hn\u2081, hn\u2082, -\u27e9 := hX.mem_morseTrajectoryPairs.1 hn\n exact (hX.antitone_flow (w n).1).reflect_lt (by simpa [hTn, hn\u2081, hn\u2082] using h\u2082\u2081)", "proof_lines": 11, "proof_length": 547, "rev": "75c8aed5fea63047615a25a9763fd5b68a86e891", "heartbeats": 544, "image": "lean-compression:tauceti-75c8aed5fe-a608030cfc", "split": "dev"} {"path": "TauCeti/MeasureTheory/OptimalTransport/Cost/Quadratic.lean", "module": "TauCeti.MeasureTheory.OptimalTransport.Cost.Quadratic", "theorem": "TauCeti.IsCoupling.integral_inner_le", "prefix": "/-\nCopyright (c) 2026 The Tau Ceti contributors. All rights reserved.\nReleased under Apache 2.0 license as described in the file LICENSE.\nAuthors: The Tau Ceti contributors\n-/\nmodule\n\npublic import Mathlib.Analysis.InnerProductSpace.Basic\npublic import TauCeti.MeasureTheory.OptimalTransport.Cost.Pairing\npublic import Mathlib.MeasureTheory.Function.L2Space\n\n/-!\n# The quadratic transport cost and its cyclically monotone sets\n\nOn a real inner product space `E`, the quadratic transport cost `c (x, y) = \u2016x - y\u2016 ^ 2 / 2`\ndiffers from the pairing cost `-\u27eax, y\u27eb` of `TauCeti.MeasureTheory.OptimalTransport.Cost.Pairing`\nby the split term `\u2016x\u2016 ^ 2 / 2 + \u2016y\u2016 ^ 2 / 2`. Split terms are invisible to cyclical\nmonotonicity, so a set is `c`-cyclically monotone for the quadratic cost exactly when it is\ncyclically monotone in the classical sense `\u2211 i, \u27eax i, y (\u03c3 i)\u27eb \u2264 \u2211 i, \u27eax i, y i\u27eb`. The\n`c`-transform vocabulary of the quadratic cost is the Legendre\u2013Fenchel vocabulary of the inner\nproduct; that dictionary is recorded in\n`TauCeti.MeasureTheory.OptimalTransport.CTransform.Quadratic`. Every statement in this file\naccounts for the factor `1 / 2` in the cost. The same factor connects a minimizer of the\nhalf-squared cost to a minimizer of squared ground distance, as used by `W\u2082`.\n\n## Main statements\n\n* `TauCeti.norm_sub_sq_div_two_eq_pairingCost_add_add` \u2014 the quadratic cost is the pairing cost\n of the inner product plus the split term `\u2016x\u2016 ^ 2 / 2 + \u2016y\u2016 ^ 2 / 2`;\n* `TauCeti.isCyclicallyMonotone_norm_sub_sq_div_two_iff` \u2014 `c`-cyclical monotonicity for the\n quadratic cost is cyclical monotonicity for the inner-product pairing, with\n `TauCeti.isCyclicallyMonotone_norm_sub_sq_div_two_iff_forall_sum_inner_le` its classical\n sum form;\n* `TauCeti.continuous_ofReal_norm_sub_sq_div_two` \u2014 the quadratic cost, as an extended\n nonnegative cost, is continuous, hence measurable;\n* `TauCeti.edist_rpow_two_eq_two_mul_ofReal_norm_sub_sq_div_two`,\n `TauCeti.isOptimalCoupling_edist_rpow_two_of_norm_sub_sq_div_two` and\n `TauCeti.isOptimalCoupling_norm_sub_sq_div_two_of_edist_rpow_two` \u2014 convert between the\n half-squared Brenier cost and the squared-distance cost without changing optimal couplings;\n* `TauCeti.IsCoupling.lintegral_norm_sub_sq_div_two` and\n `TauCeti.IsCoupling.integral_inner_le` \u2014 for marginals with finite second moments, the quadratic\n cost of a plan is a second-moment term minus its correlation, and the correlation is at most\n that term; `ProbabilityTheory.HasLaw.lintegral_norm_sub_sq_div_two` is the identity for a pair\n of random variables.\n\n## References\n\n* C. Villani, *Topics in Optimal Transportation*, Graduate Studies in Mathematics 58, 2003,\n \u00a72.1, where the quadratic cost is reduced to the inner-product pairing.\n-/\n\npublic section\n\nnoncomputable section\n\nopen MeasureTheory ProbabilityTheory\nopen scoped ENNReal RealInnerProductSpace\n\nnamespace TauCeti\n\nvariable {E : Type*} [NormedAddCommGroup E] [InnerProductSpace \u211d E]\n\n/-- The quadratic cost is the inner-product pairing cost plus the split term\n`\u2016x\u2016 ^ 2 / 2 + \u2016y\u2016 ^ 2 / 2`. -/\ntheorem norm_sub_sq_div_two_eq_pairingCost_add_add :\n (fun p : E \u00d7 E => \u2016p.1 - p.2\u2016 ^ 2 / 2) =\n fun p => pairingCost (inner\u2097 E) p + \u2016p.1\u2016 ^ 2 / 2 + \u2016p.2\u2016 ^ 2 / 2 := by\n funext p\n rw [pairingCost_apply, inner\u2097_apply_apply, norm_sub_sq_real]\n ring\n\n/-- `c`-cyclical monotonicity for the quadratic cost is cyclical monotonicity for the\ninner-product pairing. -/\ntheorem isCyclicallyMonotone_norm_sub_sq_div_two_iff {S : Set (E \u00d7 E)} :\n IsCyclicallyMonotone (fun p : E \u00d7 E => \u2016p.1 - p.2\u2016 ^ 2 / 2) S \u2194\n IsCyclicallyMonotone (pairingCost (inner\u2097 E)) S := by\n rw [norm_sub_sq_div_two_eq_pairingCost_add_add,\n isCyclicallyMonotone_add_add_iff (pairingCost (inner\u2097 E)) (fun x => \u2016x\u2016 ^ 2 / 2)\n fun y => \u2016y\u2016 ^ 2 / 2]\n\n/-- `c`-cyclical monotonicity for the quadratic cost is the classical cyclical monotonicity\ncondition: rearranging the targets of finitely many points of the set does not increase the\ntotal inner product. -/\ntheorem isCyclicallyMonotone_norm_sub_sq_div_two_iff_forall_sum_inner_le {S : Set (E \u00d7 E)} :\n IsCyclicallyMonotone (fun p : E \u00d7 E => \u2016p.1 - p.2\u2016 ^ 2 / 2) S \u2194\n \u2200 (n : \u2115) (x y : Fin n \u2192 E), (\u2200 i, (x i, y i) \u2208 S) \u2192\n \u2200 \u03c3 : Equiv.Perm (Fin n), \u2211 i, \u27eax i, y (\u03c3 i)\u27eb \u2264 \u2211 i, \u27eax i, y i\u27eb := by\n rw [isCyclicallyMonotone_norm_sub_sq_div_two_iff, isCyclicallyMonotone_pairingCost_iff]\n simp only [inner\u2097_apply_apply]\n\nend TauCeti\n\nnamespace TauCeti\n\nvariable {F : Type*} [NormedAddCommGroup F] [MeasurableSpace F]\n\nomit [MeasurableSpace F] in\n/-- The half-squared-displacement cost `\u2016x - y\u2016 ^ 2 / 2`, as an extended nonnegative cost, is\ncontinuous. -/\ntheorem continuous_ofReal_norm_sub_sq_div_two :\n Continuous fun z : F \u00d7 F => ENNReal.ofReal (\u2016z.1 - z.2\u2016 ^ 2 / 2) :=\n ENNReal.continuous_ofReal.comp (((continuous_fst.sub continuous_snd).norm.pow 2).div_const 2)\n\nomit [MeasurableSpace F] in\n/-- Squared distance is twice the half-squared-displacement cost. This identity accounts for\nthe factor `1 / 2` in the quadratic Brenier cost when reading a plan as a `W\u2082` plan. -/\ntheorem edist_rpow_two_eq_two_mul_ofReal_norm_sub_sq_div_two (z : F \u00d7 F) :\n edist z.1 z.2 ^ (2 : \u211d) =\n (2 : \u211d\u22650\u221e) * ENNReal.ofReal (\u2016z.1 - z.2\u2016 ^ 2 / 2) := by\n rw [edist_dist, ENNReal.ofReal_rpow_of_nonneg dist_nonneg (by norm_num), dist_eq_norm]\n rw [Real.rpow_ofNat]\n calc\n ENNReal.ofReal (\u2016z.1 - z.2\u2016 ^ 2) =\n ENNReal.ofReal (2 * (\u2016z.1 - z.2\u2016 ^ 2 / 2)) := congrArg _ (by ring)\n _ = _ := by rw [ENNReal.ofReal_mul (by norm_num : (0 : \u211d) \u2264 2)]; norm_num\n\n/-- A coupling optimal for the half-squared-displacement cost is optimal for squared distance.\nThe factor of two is positive, so it preserves the minimizing plans even when the value is\ninfinite. -/\ntheorem isOptimalCoupling_edist_rpow_two_of_norm_sub_sq_div_two\n {\u03bc \u03bd : Measure F} {\u03c0 : Measure (F \u00d7 F)}\n (h\u03c0 : IsOptimalCoupling\n (fun z \u21a6 ENNReal.ofReal (\u2016z.1 - z.2\u2016 ^ 2 / 2)) \u03c0 \u03bc \u03bd) :\n IsOptimalCoupling (fun z \u21a6 edist z.1 z.2 ^ (2 : \u211d)) \u03c0 \u03bc \u03bd := by\n simpa only [\u2190 edist_rpow_two_eq_two_mul_ofReal_norm_sub_sq_div_two] using\n h\u03c0.const_mul (a := 2) ENNReal.ofNat_ne_top\n\n/-- A coupling optimal for squared distance is optimal for the half-squared-displacement cost.\nThe factor of one half is positive and finite, so it preserves the minimizing plans even when the\nvalue is infinite. -/\ntheorem isOptimalCoupling_norm_sub_sq_div_two_of_edist_rpow_two\n {\u03bc \u03bd : Measure F} {\u03c0 : Measure (F \u00d7 F)}\n (h\u03c0 : IsOptimalCoupling (fun z \u21a6 edist z.1 z.2 ^ (2 : \u211d)) \u03c0 \u03bc \u03bd) :\n IsOptimalCoupling (fun z \u21a6 ENNReal.ofReal (\u2016z.1 - z.2\u2016 ^ 2 / 2)) \u03c0 \u03bc \u03bd := by\n simpa only [edist_rpow_two_eq_two_mul_ofReal_norm_sub_sq_div_two,\n ENNReal.inv_mul_cancel_left two_ne_zero ENNReal.ofNat_ne_top] using\n h\u03c0.const_mul (a := 2\u207b\u00b9) (ENNReal.inv_ne_top.2 two_ne_zero)\n\nend TauCeti\n\nnamespace TauCeti\n\n/-! ### Second moments and correlation -/\n\nvariable {E : Type*} [NormedAddCommGroup E] [InnerProductSpace \u211d E] [MeasurableSpace E]\n {\u03bc \u03bd : Measure E} {\u03c3 : Measure (E \u00d7 E)}\n\n/-- Against a coupling of two measures with finite second moments, the correlation\n`\u27eax, y\u27eb` is integrable. -/\ntheorem IsCoupling.integrable_inner (h\u03c3 : IsCoupling \u03c3 \u03bc \u03bd) (h\u03bc : MemLp id 2 \u03bc)\n (h\u03bd : MemLp id 2 \u03bd) : Integrable (fun z : E \u00d7 E => \u27eaz.1, z.2\u27eb) \u03c3 := by\n have h\u03bc2 : Integrable (fun x : E => \u2016x\u2016 ^ 2) \u03bc :=\n (memLp_two_iff_integrable_sq_norm h\u03bc.aestronglyMeasurable).1 h\u03bc\n have h\u03bd2 : Integrable (fun y : E => \u2016y\u2016 ^ 2) \u03bd :=\n (memLp_two_iff_integrable_sq_norm h\u03bd.aestronglyMeasurable).1 h\u03bd\n refine ((h\u03c3.integrable_comp_fst h\u03bc2).add (h\u03c3.integrable_comp_snd h\u03bd2)).mono'\n ((h\u03bc.aestronglyMeasurable.comp_measurePreserving h\u03c3.measurePreserving_fst).inner\n (h\u03bd.aestronglyMeasurable.comp_measurePreserving h\u03c3.measurePreserving_snd))\n (.of_forall fun z => ?_)\n simp only [Pi.add_apply, Real.norm_eq_abs]\n nlinarith [abs_real_inner_le_norm z.1 z.2, sq_nonneg (\u2016z.1\u2016 - \u2016z.2\u2016)]\n\n/-- **The quadratic cost of a plan is a second-moment term minus the correlation.** For a\ncoupling `\u03c3` of two measures with finite second moments,\n`\u222b \u2016x - y\u2016 ^ 2 / 2 d\u03c3 = (\u222b \u2016x\u2016 ^ 2 d\u03bc + \u222b \u2016y\u2016 ^ 2 d\u03bd) / 2 - \u222b \u27eax, y\u27eb d\u03c3`, so minimising the\nquadratic cost over the couplings of `\u03bc` and `\u03bd` is maximising the correlation. -/\ntheorem IsCoupling.lintegral_norm_sub_sq_div_two (h\u03c3 : IsCoupling \u03c3 \u03bc \u03bd) (h\u03bc : MemLp id 2 \u03bc)\n (h\u03bd : MemLp id 2 \u03bd) :\n \u222b\u207b z, ENNReal.ofReal (\u2016z.1 - z.2\u2016 ^ 2 / 2) \u2202\u03c3 =\n ENNReal.ofReal ((\u222b x, \u2016x\u2016 ^ 2 \u2202\u03bc + \u222b y, \u2016y\u2016 ^ 2 \u2202\u03bd) / 2 - \u222b z, \u27eaz.1, z.2\u27eb \u2202\u03c3) := by\n have h\u03bc2 : Integrable (fun x : E => \u2016x\u2016 ^ 2) \u03bc :=\n (memLp_two_iff_integrable_sq_norm h\u03bc.aestronglyMeasurable).1 h\u03bc\n have h\u03bd2 : Integrable (fun y : E => \u2016y\u2016 ^ 2) \u03bd :=\n (memLp_two_iff_integrable_sq_norm h\u03bd.aestronglyMeasurable).1 h\u03bd\n have h\u2081 := h\u03c3.integrable_comp_fst h\u03bc2\n have h\u2082 := h\u03c3.integrable_comp_snd h\u03bd2\n have h\u2083 := h\u03c3.integrable_inner h\u03bc h\u03bd\n have heq : (fun z : E \u00d7 E => \u2016z.1 - z.2\u2016 ^ 2 / 2) =\n fun z => (\u2016z.1\u2016 ^ 2 + \u2016z.2\u2016 ^ 2) / 2 - \u27eaz.1, z.2\u27eb := by\n rw [norm_sub_sq_div_two_eq_pairingCost_add_add]\n ext z\n rw [pairingCost_apply, inner\u2097_apply_apply]\n ring\n have h\u2081\u2082 : Integrable (fun z : E \u00d7 E => (\u2016z.1\u2016 ^ 2 + \u2016z.2\u2016 ^ 2) / 2) \u03c3 :=\n (h\u2081.add h\u2082).div_const 2\n have hint : Integrable (fun z : E \u00d7 E => \u2016z.1 - z.2\u2016 ^ 2 / 2) \u03c3 := heq \u25b8 h\u2081\u2082.sub h\u2083\n rw [\u2190 ofReal_integral_eq_lintegral_ofReal hint (.of_forall fun z => by positivity), heq,\n integral_sub h\u2081\u2082 h\u2083, integral_div, integral_add h\u2081 h\u2082,\n h\u03c3.integral_comp_fst h\u03bc2.aestronglyMeasurable, h\u03c3.integral_comp_snd h\u03bd2.aestronglyMeasurable]\n\n", "statement": "/-- **The correlation of a plan is bounded by the second moments.** For a coupling `\u03c3` of two\nmeasures with finite second moments, `\u222b \u27eax, y\u27eb d\u03c3 \u2264 (\u222b \u2016x\u2016 ^ 2 d\u03bc + \u222b \u2016y\u2016 ^ 2 d\u03bd) / 2`. -/\ntheorem IsCoupling.integral_inner_le (h\u03c3 : IsCoupling \u03c3 \u03bc \u03bd) (h\u03bc : MemLp id 2 \u03bc)\n (h\u03bd : MemLp id 2 \u03bd) :\n \u222b z, \u27eaz.1, z.2\u27eb \u2202\u03c3 \u2264 (\u222b x, \u2016x\u2016 ^ 2 \u2202\u03bc + \u222b y, \u2016y\u2016 ^ 2 \u2202\u03bd) / 2 ", "proof": " by\n -- Integrate `\u27eax, y\u27eb \u2264 (\u2016x\u2016 ^ 2 + \u2016y\u2016 ^ 2) / 2` against `\u03c3`.\n have h\u03bc2 : Integrable (fun x : E => \u2016x\u2016 ^ 2) \u03bc :=\n (memLp_two_iff_integrable_sq_norm h\u03bc.aestronglyMeasurable).1 h\u03bc\n have h\u03bd2 : Integrable (fun y : E => \u2016y\u2016 ^ 2) \u03bd :=\n (memLp_two_iff_integrable_sq_norm h\u03bd.aestronglyMeasurable).1 h\u03bd\n rw [\u2190 h\u03c3.integral_comp_fst h\u03bc2.aestronglyMeasurable,\n \u2190 h\u03c3.integral_comp_snd h\u03bd2.aestronglyMeasurable,\n \u2190 integral_add (h\u03c3.integrable_comp_fst h\u03bc2) (h\u03c3.integrable_comp_snd h\u03bd2), \u2190 integral_div]\n refine integral_mono (h\u03c3.integrable_inner h\u03bc h\u03bd)\n (((h\u03c3.integrable_comp_fst h\u03bc2).add (h\u03c3.integrable_comp_snd h\u03bd2)).div_const 2) fun z => ?_\n nlinarith [real_inner_le_norm z.1 z.2, sq_nonneg (\u2016z.1\u2016 - \u2016z.2\u2016)]", "proof_lines": 11, "proof_length": 627, "rev": "75c8aed5fea63047615a25a9763fd5b68a86e891", "heartbeats": 2056, "image": "lean-compression:tauceti-75c8aed5fe-a608030cfc", "split": "dev"} {"path": "TauCeti/CategoryTheory/Limits/Replete.lean", "module": "TauCeti.CategoryTheory.Limits.Replete", "theorem": "TauCeti.IsReplete.epi_pi_map", "prefix": "/-\nCopyright (c) 2026 The Tau Ceti contributors. All rights reserved.\nReleased under Apache 2.0 license as described in the file LICENSE.\nAuthors: The Tau Ceti contributors\n-/\nmodule\n\npublic import Mathlib.CategoryTheory.Abelian.GrothendieckAxioms.Basic\npublic import Mathlib.CategoryTheory.Abelian.Monomorphisms\npublic import Mathlib.CategoryTheory.Functor.OfSequence\npublic import Mathlib.CategoryTheory.Functor.ReflectsIso.Jointly\npublic import Mathlib.CategoryTheory.Limits.FunctorCategory.EpiMono\npublic import Mathlib.CategoryTheory.Limits.Shapes.SequentialProduct\npublic import Mathlib.CategoryTheory.Limits.Types.Images\npublic import Mathlib.CategoryTheory.MorphismProperty.Limits\npublic import TauCeti.CategoryTheory.Limits.Final\npublic import TauCeti.CategoryTheory.Limits.Pi\npublic import TauCeti.CategoryTheory.Limits.Shapes.Pullback.Pi\npublic import TauCeti.CategoryTheory.Products.Basic\n\n/-!\n# Replete categories\n\nA category is *replete* (Bhatt\u2013Scholze) when sequential limits of epimorphisms are epimorphisms:\nfor every tower `\u22ef \u27f6 F (n + 1) \u27f6 F n \u27f6 \u22ef \u27f6 F 0` whose transition maps are epimorphisms, the\nprojection `lim F \u27f6 F 0` is an epimorphism. The category of types is replete. Repleteness is what\nmakes inverse limits of sheaves behave like inverse limits of sets: on a replete topos, countable\nproducts are exact and derived limits of towers have amplitude `[0, 1]` (Bhatt\u2013Scholze,\nPropositions 3.1.9 and 3.1.11).\n\nThe main results here hold in a replete category in which epimorphisms are stable under base\nchange. First, a morphism of towers `\u03c6 : F \u27f6 G` induces an epimorphism `lim F \u27f6 lim G` as soon as\n`F 0 \u27f6 G 0` and every comparison map `F (n + 1) \u27f6 F n \u00d7_{G n} G (n + 1)` are epimorphisms\n(`TauCeti.IsReplete.epi_isLimitMap`, `TauCeti.IsReplete.epi_limMap`). Levelwise epimorphisms do\nnot suffice, already for sets.\nSecond, a countable product of epimorphisms is an epimorphism (`TauCeti.IsReplete.epi_pi_map`), so\ncountable products are exact in a replete abelian category (`TauCeti.IsReplete.countableAB4Star`).\nLight condensed sets and modules are replete, see `TauCeti.Condensed.Light.Replete`; sheaves with\nvalues in a concrete category over a replete topos form a replete category, see\n`TauCeti.CategoryTheory.Sites.Replete`.\n\n## Main declarations\n\n* `TauCeti.IsReplete`: replete categories.\n* `TauCeti.IsReplete.epi_\u03c0_app`: in a replete category, every projection of a sequential limit\n of epimorphisms is an epimorphism.\n* `TauCeti.IsReplete.of_reflectsEpimorphisms`: repleteness descends along a functor that preserves\n sequential limits and preserves and reflects epimorphisms.\n* `TauCeti.IsReplete.of_jointlyReflectEpimorphisms`: repleteness descends along a family of\n functors that jointly reflect epimorphisms and individually preserve sequential limits and\n epimorphisms.\n* `TauCeti.IsReplete.of_equivalence`: repleteness is invariant under equivalence of categories.\n* `TauCeti.isReplete_pi`, `TauCeti.isReplete_prod`: indexed and binary products of replete\n categories are replete.\n* `TauCeti.IsReplete.epi_isLimitMap`, `TauCeti.IsReplete.epi_limMap`: the induced map of limits of\n a morphism of towers whose comparison maps are epimorphisms is an epimorphism.\n* `TauCeti.IsReplete.epi_pi_map`: a countable product of epimorphisms is an epimorphism.\n* `TauCeti.IsReplete.countableAB4Star`: a replete abelian category with countable products\n satisfies `CountableAB4Star`.\n* `TauCeti.isReplete_type`: the category of types is replete.\n\n## Implementation notes\n\n`TauCeti.IsReplete.epi_isLimitMap` applies repleteness to the tower `lim G \u00d7_{G n} F n`, whose\ntransition maps are base changes of the comparison maps and whose limit is `lim F`.\n\nFor `TauCeti.IsReplete.epi_pi_map` over `\u2115`, Mathlib's `CategoryTheory.Limits.SequentialProduct`\nexhibits `\u220f X` as the limit of the tower `\u220f_{m < n} X m \u00d7 \u220f_{m \u2265 n} Y m`, whose first projection\nis `\u220f f`. Its transition maps apply one `f n` at a time, so they are base changes of the `f n`\n(`CategoryTheory.IsPullback.of_pi_map_of_isIso`), and repleteness applies. This generalizes\nMathlib's proof that countable products of epimorphisms of light condensed modules are\nepimorphisms, in `Mathlib.Condensed.Light.Epi` (Dagur Asgeirsson), from light condensed modules to\nreplete categories. A product over another nonempty countable type is a retract of a product over\n`\u2115`, by reindexing along a surjection.\n\n`TauCeti.IsReplete.countableAB4Star` likewise generalizes Mathlib's proof of `CountableAB4Star`\nfor light condensed modules (`Mathlib.Condensed.Light.Epi` and `Mathlib.Condensed.Light.AB`) to\nreplete abelian categories.\n\n## References\n\n* B. Bhatt and P. Scholze, *The pro-\u00e9tale topology for schemes*, Ast\u00e9risque 369 (2015),\n Definition 3.1.1, Lemma 3.1.8 and Proposition 3.1.9.\n-/\n\npublic section\n\nuniverse v v' u u'\n\nopen CategoryTheory Limits\n\nnamespace TauCeti\n\nvariable (C : Type u) [Category.{v} C]\n\n/-- A category is **replete** when sequential limits of epimorphisms are epimorphisms: for every\ntower `\u22ef \u27f6 F (n + 1) \u27f6 F n \u27f6 \u22ef \u27f6 F 0` whose transition maps are epimorphisms, the projection\n`lim F \u27f6 F 0` of every limit cone is an epimorphism. Every projection `lim F \u27f6 F n` is then an\nepimorphism (`TauCeti.IsReplete.epi_\u03c0_app`). -/\nclass IsReplete : Prop where\n /-- The projection `lim F \u27f6 F 0` of a sequential limit of epimorphisms is an epimorphism. -/\n epi_\u03c0_app_zero {F : \u2115\u1d52\u1d56 \u2964 C} (hF : \u2200 n, Epi (F.map (homOfLE (Nat.le_succ n)).op))\n {c : Cone F} (hc : IsLimit c) : Epi (c.\u03c0.app \u27e80\u27e9)\n\n/-- The category of types is replete: a sequential limit of surjections is surjective. -/\ninstance isReplete_type : IsReplete (Type u) where\n epi_\u03c0_app_zero hF _ hc := (epi_iff_surjective _).2 <|\n Types.surjective_\u03c0_app_zero_of_surjective_map hc fun n \u21a6 (epi_iff_surjective _).1 (hF n)\n\nnamespace IsReplete\n\nvariable {C}\n\n/-- In a replete category, every projection `lim F \u27f6 F n` of a sequential limit of epimorphisms is\nan epimorphism. -/\ntheorem epi_\u03c0_app [IsReplete C] {F : \u2115\u1d52\u1d56 \u2964 C} (hF : \u2200 n, Epi (F.map (homOfLE (Nat.le_succ n)).op))\n {c : Cone F} (hc : IsLimit c) (n : \u2115) : Epi (c.\u03c0.app \u27e8n\u27e9) := by\n -- Reindex along `m \u21a6 n + m`, which is cofinal, so that the `n`-th projection becomes the first.\n -- The transition maps of the reindexed tower are those of `F`, and its first projection is\n -- `c.\u03c0.app \u27e8n + 0\u27e9 = c.\u03c0.app \u27e8n\u27e9`, by unfolding `Monotone.functor` and `Nat.add`.\n exact epi_\u03c0_app_zero (c := c.whisker _) (fun m \u21a6 hF (n + m))\n (hc.whiskerOfCofinal \u27e8(n + \u00b7), fun _ _ h \u21a6 Nat.add_le_add_left h n\u27e9\n fun m \u21a6 \u27e8m, Nat.le_add_left m n\u27e9)\n\n/-- **Repleteness descends along functors that preserve sequential limits and preserve and reflect\nepimorphisms.** If `G : D \u2964 C` is such a functor and `C` is replete, then so is `D`. -/\ntheorem of_reflectsEpimorphisms [IsReplete C] {D : Type u'} [Category.{v'} D] (G : D \u2964 C)\n [PreservesLimitsOfShape \u2115\u1d52\u1d56 G] [G.PreservesEpimorphisms] [G.ReflectsEpimorphisms] :\n IsReplete D where\n epi_\u03c0_app_zero {_} hF {_} hc :=\n G.epi_of_epi_map (epi_\u03c0_app_zero (fun n \u21a6 have := hF n; G.map_epi _) (isLimitOfPreserves G hc))\n\n/-- **Repleteness descends along families of functors that jointly reflect epimorphisms.** If each\nfunctor `G i : D \u2964 E i` preserves sequential limits and epimorphisms, every `E i` is replete, and\nthe family `G` jointly reflects epimorphisms, then `D` is replete. -/\ntheorem of_jointlyReflectEpimorphisms {I : Type*} {E : I \u2192 Type*} [\u2200 i, Category (E i)]\n [\u2200 i, IsReplete (E i)] {D : Type u'} [Category.{v'} D] {G : \u2200 i, D \u2964 E i}\n (hG : JointlyReflectEpimorphisms G) [\u2200 i, PreservesLimitsOfShape \u2115\u1d52\u1d56 (G i)]\n [\u2200 i, (G i).PreservesEpimorphisms] : IsReplete D where\n epi_\u03c0_app_zero {_} hF {_} hc := (hG.epi_iff _).2 fun i \u21a6\n epi_\u03c0_app_zero (fun n \u21a6 have := hF n; (G i).map_epi _) (isLimitOfPreserves (G i) hc)\n\n/-- **Repleteness is invariant under equivalence of categories.** -/\ntheorem of_equivalence [IsReplete C] {D : Type u'} [Category.{v'} D] (e : C \u224c D) : IsReplete D :=\n of_reflectsEpimorphisms e.inverse\n\nend IsReplete\n\n/-- An indexed product of replete categories is replete: sequential limits and epimorphisms in\n`\u2200 i, D i` are detected componentwise. -/\ninstance isReplete_pi {I : Type*} {D : I \u2192 Type*} [\u2200 i, Category (D i)] [\u2200 i, IsReplete (D i)] :\n IsReplete (\u2200 i, D i) :=\n IsReplete.of_jointlyReflectEpimorphisms\n (CategoryTheory.Pi.jointlyFaithful_eval D).jointlyReflectEpimorphisms\n\n/-- A Cartesian product of replete categories is replete. -/\ninstance isReplete_prod {D : Type u'} [Category.{v'} D] [IsReplete C] [IsReplete D] :\n IsReplete (C \u00d7 D) where\n epi_\u03c0_app_zero {_} hF {_} hc := (CategoryTheory.Prod.epi_iff _).2\n \u27e8IsReplete.epi_\u03c0_app_zero (fun n \u21a6 ((CategoryTheory.Prod.epi_iff _).1 (hF n)).1)\n (isLimitOfPreserves (CategoryTheory.Prod.fst C D) hc),\n IsReplete.epi_\u03c0_app_zero (fun n \u21a6 ((CategoryTheory.Prod.epi_iff _).1 (hF n)).2)\n (isLimitOfPreserves (CategoryTheory.Prod.snd C D) hc)\u27e9\n\nnamespace IsReplete\n\nvariable {C}\n\nsection Map\n\nvariable [HasPullbacks C] {F G : \u2115\u1d52\u1d56 \u2964 C} (\u03c6 : F \u27f6 G) (cG : Cone G)\n\n/-- The map `lim G \u00d7_{G (n + 1)} F (n + 1) \u27f6 lim G \u00d7_{G n} F n` induced by the transition map\nof `F`. -/\nprivate noncomputable def pullbackTowerMap (n : \u2115) :\n pullback (cG.\u03c0.app \u27e8n + 1\u27e9) (\u03c6.app \u27e8n + 1\u27e9) \u27f6 pullback (cG.\u03c0.app \u27e8n\u27e9) (\u03c6.app \u27e8n\u27e9) :=\n pullback.lift (pullback.fst _ _) (pullback.snd _ _ \u226b F.map (homOfLE (Nat.le_succ n)).op) (by\n rw [Category.assoc, \u03c6.naturality, \u2190 cG.w (homOfLE (Nat.le_succ n)).op,\n pullback.condition_assoc])\n\n/-- The tower `lim G \u00d7_{G n} F n` used in the proof of `TauCeti.IsReplete.epi_isLimitMap`. -/\nprivate noncomputable def pullbackTower : \u2115\u1d52\u1d56 \u2964 C :=\n Functor.ofOpSequence (X := fun n \u21a6 pullback (cG.\u03c0.app \u27e8n\u27e9) (\u03c6.app \u27e8n\u27e9)) (pullbackTowerMap \u03c6 cG)\n\nnamespace pullbackTower\n\n/-- The projection `lim G \u00d7_{G n} F n \u27f6 lim G`. -/\nprivate noncomputable def fst (n : \u2115) : (pullbackTower \u03c6 cG).obj \u27e8n\u27e9 \u27f6 cG.pt :=\n pullback.fst (cG.\u03c0.app \u27e8n\u27e9) (\u03c6.app \u27e8n\u27e9)\n\n/-- The projection `lim G \u00d7_{G n} F n \u27f6 F n`. -/\nprivate noncomputable def snd (n : \u2115) : (pullbackTower \u03c6 cG).obj \u27e8n\u27e9 \u27f6 F.obj \u27e8n\u27e9 :=\n pullback.snd (cG.\u03c0.app \u27e8n\u27e9) (\u03c6.app \u27e8n\u27e9)\n\n/-- The map into `lim G \u00d7_{G n} F n` given by compatible maps into `lim G` and `F n`. -/\nprivate noncomputable def lift {Z : C} (n : \u2115) (a : Z \u27f6 cG.pt) (b : Z \u27f6 F.obj \u27e8n\u27e9)\n (w : a \u226b cG.\u03c0.app \u27e8n\u27e9 = b \u226b \u03c6.app \u27e8n\u27e9) : Z \u27f6 (pullbackTower \u03c6 cG).obj \u27e8n\u27e9 :=\n pullback.lift a b w\n\n@[reassoc (attr := simp)]\nprivate lemma lift_fst {Z : C} (n : \u2115) (a : Z \u27f6 cG.pt) (b : Z \u27f6 F.obj \u27e8n\u27e9)\n (w : a \u226b cG.\u03c0.app \u27e8n\u27e9 = b \u226b \u03c6.app \u27e8n\u27e9) : lift \u03c6 cG n a b w \u226b fst \u03c6 cG n = a :=\n pullback.lift_fst _ _ _\n\n@[reassoc (attr := simp)]\nprivate lemma lift_snd {Z : C} (n : \u2115) (a : Z \u27f6 cG.pt) (b : Z \u27f6 F.obj \u27e8n\u27e9)\n (w : a \u226b cG.\u03c0.app \u27e8n\u27e9 = b \u226b \u03c6.app \u27e8n\u27e9) : lift \u03c6 cG n a b w \u226b snd \u03c6 cG n = b :=\n pullback.lift_snd _ _ _\n\nprivate lemma hom_ext {Z : C} {n : \u2115} {f g : Z \u27f6 (pullbackTower \u03c6 cG).obj \u27e8n\u27e9}\n (h\u2081 : f \u226b fst \u03c6 cG n = g \u226b fst \u03c6 cG n) (h\u2082 : f \u226b snd \u03c6 cG n = g \u226b snd \u03c6 cG n) : f = g :=\n pullback.hom_ext h\u2081 h\u2082\n\n@[reassoc]\nprivate lemma condition (n : \u2115) : fst \u03c6 cG n \u226b cG.\u03c0.app \u27e8n\u27e9 = snd \u03c6 cG n \u226b \u03c6.app \u27e8n\u27e9 :=\n pullback.condition\n\nprivate lemma map_succ (n : \u2115) :\n (pullbackTower \u03c6 cG).map (homOfLE (Nat.le_succ n)).op = pullbackTowerMap \u03c6 cG n :=\n Functor.ofOpSequence_map_homOfLE_succ _ n\n\n@[reassoc (attr := simp)]\nprivate lemma map_succ_fst (n : \u2115) :\n (pullbackTower \u03c6 cG).map (homOfLE (Nat.le_succ n)).op \u226b fst \u03c6 cG n = fst \u03c6 cG (n + 1) := by\n rw [map_succ]\n exact pullback.lift_fst _ _ _\n\n@[reassoc (attr := simp)]\nprivate lemma map_succ_snd (n : \u2115) :\n (pullbackTower \u03c6 cG).map (homOfLE (Nat.le_succ n)).op \u226b snd \u03c6 cG n =\n snd \u03c6 cG (n + 1) \u226b F.map (homOfLE (Nat.le_succ n)).op := by\n rw [map_succ]\n exact pullback.lift_snd _ _ _\n\n/-- The first projection of a cone over the tower `lim G \u00d7_{G n} F n` does not depend on `n`. -/\nprivate lemma \u03c0_app_fst (s : Cone (pullbackTower \u03c6 cG)) (n : \u2115) :\n s.\u03c0.app \u27e8n\u27e9 \u226b fst \u03c6 cG n = s.\u03c0.app \u27e80\u27e9 \u226b fst \u03c6 cG 0 := by\n induction n with\n | zero => rfl\n | succ n ih => rw [\u2190 ih, \u2190 s.w (homOfLE (Nat.le_succ n)).op, Category.assoc, map_succ_fst]\n\n/-- The transition maps of the tower `lim G \u00d7_{G n} F n` are base changes of the comparison maps\n`F (n + 1) \u27f6 F n \u00d7_{G n} G (n + 1)`, along the map\n`lim G \u00d7_{G n} F n \u27f6 F n \u00d7_{G n} G (n + 1)` induced by the projection `lim G \u27f6 G (n + 1)`. -/\nprivate lemma isPullback_map_succ (n : \u2115) :\n IsPullback (snd \u03c6 cG (n + 1)) ((pullbackTower \u03c6 cG).map (homOfLE (Nat.le_succ n)).op)\n (pullback.lift (F.map (homOfLE (Nat.le_succ n)).op) (\u03c6.app \u27e8n + 1\u27e9) (\u03c6.naturality _))\n (pullback.lift (snd \u03c6 cG n) (fst \u03c6 cG n \u226b cG.\u03c0.app \u27e8n + 1\u27e9) (by\n rw [\u2190 condition, Category.assoc, cG.w (homOfLE (Nat.le_succ n)).op])) := by\n -- Paste below it the square comparing `lim G \u00d7_{G n} F n` with `F n \u00d7_{G n} G (n + 1)`, which\n -- is itself a pullback because pasting it with the square defining `F n \u00d7_{G n} G (n + 1)`\n -- gives the square defining `lim G \u00d7_{G n} F n`.\n have hbot : IsPullback\n (pullback.lift (snd \u03c6 cG n) (fst \u03c6 cG n \u226b cG.\u03c0.app \u27e8n + 1\u27e9) (by\n rw [\u2190 condition, Category.assoc, cG.w (homOfLE (Nat.le_succ n)).op]))\n (fst \u03c6 cG n) (pullback.snd _ _) (cG.\u03c0.app \u27e8n + 1\u27e9) := by\n refine IsPullback.of_right ?_ (pullback.lift_snd _ _ _) (IsPullback.of_hasPullback _ _)\n rw [pullback.lift_fst, cG.w (homOfLE (Nat.le_succ n)).op]\n exact (IsPullback.of_hasPullback (cG.\u03c0.app \u27e8n\u27e9) (\u03c6.app \u27e8n\u27e9)).flip\n refine IsPullback.of_bot ?_ (pullback.hom_ext (by simp) (by simp [condition])) hbot\n rw [map_succ_fst, pullback.lift_snd]\n exact (IsPullback.of_hasPullback (cG.\u03c0.app \u27e8n + 1\u27e9) (\u03c6.app \u27e8n + 1\u27e9)).flip\n\nprivate lemma isPullback_fst_zero :\n IsPullback (snd \u03c6 cG 0) (fst \u03c6 cG 0) (\u03c6.app \u27e80\u27e9) (cG.\u03c0.app \u27e80\u27e9) :=\n (IsPullback.of_hasPullback (cG.\u03c0.app \u27e80\u27e9) (\u03c6.app \u27e80\u27e9)).flip\n\nvariable {cG} (hcG : IsLimit cG) (cF : Cone F)\n\n/-- The cone over the tower `lim G \u00d7_{G n} F n` with vertex `lim F`, with components given by\nthe induced map `lim F \u27f6 lim G` and the projections `lim F \u27f6 F n`. -/\nprivate noncomputable abbrev cone : Cone (pullbackTower \u03c6 cG) where\n pt := cF.pt\n \u03c0 := NatTrans.ofOpSequence\n (fun n \u21a6 lift \u03c6 cG n (hcG.map cF \u03c6) (cF.\u03c0.app \u27e8n\u27e9) (IsLimit.map_\u03c0 _ _ _ _)) fun n \u21a6\n hom_ext \u03c6 cG (by simp) (by simp)\n\n/-- The cone `pullbackTower.cone` is a limit cone: `lim F` is the limit of the tower\n`lim G \u00d7_{G n} F n`. -/\nprivate noncomputable def isLimitCone (hcF : IsLimit cF) :\n IsLimit (cone \u03c6 hcG cF) where\n lift s := hcF.lift\n { pt := s.pt\n \u03c0 := NatTrans.ofOpSequence (fun n \u21a6 s.\u03c0.app \u27e8n\u27e9 \u226b snd \u03c6 cG n) fun n \u21a6 by\n dsimp only [Functor.const_obj_obj, Functor.const_obj_map]\n rw [Category.id_comp, Category.assoc, \u2190 map_succ_snd, \u2190 Category.assoc, s.w] }\n fac s := by\n rintro \u27e8n\u27e9\n refine hom_ext \u03c6 cG (hcG.hom_ext fun \u27e8m\u27e9 \u21a6 ?_) (by simp)\n simp only [Category.assoc, NatTrans.ofOpSequence_app, lift_fst_assoc, IsLimit.map_\u03c0,\n IsLimit.fac_assoc]\n rw [\u2190 condition, \u2190 Category.assoc, \u2190 Category.assoc, \u03c0_app_fst \u03c6 cG s m, \u03c0_app_fst \u03c6 cG s n]\n uniq s m hm := hcF.hom_ext fun \u27e8n\u27e9 \u21a6 by\n rw [IsLimit.fac, NatTrans.ofOpSequence_app, \u2190 hm, Category.assoc, NatTrans.ofOpSequence_app,\n lift_snd]\n\nend pullbackTower\n\nvariable {cG} (hcG : IsLimit cG) [(MorphismProperty.epimorphisms C).IsStableUnderBaseChange]\n [IsReplete C]\n\n/-- **Epimorphisms of inverse limits** (Bhatt\u2013Scholze, Lemma 3.1.8). In a replete category in\nwhich epimorphisms are stable under base change, let `\u03c6 : F \u27f6 G` be a morphism of towers such that\n`F 0 \u27f6 G 0` and every comparison map `F (n + 1) \u27f6 F n \u00d7_{G n} G (n + 1)` are epimorphisms. Then\nthe induced map `lim F \u27f6 lim G` is an epimorphism. -/\ntheorem epi_isLimitMap {cF : Cone F} (hcF : IsLimit cF) (h\u2080 : Epi (\u03c6.app \u27e80\u27e9))\n (h : \u2200 n, Epi (pullback.lift (F.map (homOfLE (Nat.le_succ n)).op) (\u03c6.app \u27e8n + 1\u27e9)\n (\u03c6.naturality _))) :\n Epi (hcG.map cF \u03c6) := by\n have hW (n : \u2115) : Epi ((pullbackTower \u03c6 cG).map (homOfLE (Nat.le_succ n)).op) :=\n MorphismProperty.of_isPullback (P := MorphismProperty.epimorphisms C)\n (pullbackTower.isPullback_map_succ \u03c6 cG n) (h n)\n have hfst : Epi (pullbackTower.fst \u03c6 cG 0) :=\n MorphismProperty.of_isPullback (P := MorphismProperty.epimorphisms C)\n (pullbackTower.isPullback_fst_zero \u03c6 cG) h\u2080\n have h\u03c0 := epi_\u03c0_app_zero hW (pullbackTower.isLimitCone \u03c6 hcG cF hcF)\n rw [\u2190 pullbackTower.lift_fst \u03c6 cG 0 (hcG.map cF \u03c6) (cF.\u03c0.app \u27e80\u27e9) (IsLimit.map_\u03c0 _ _ _ _)]\n exact epi_comp' h\u03c0 hfst\n\nomit hcG in\n/-- **Epimorphisms of inverse limits** (`limMap` form; Bhatt\u2013Scholze, Lemma 3.1.8). In a replete\ncategory with pullbacks in which epimorphisms are stable under base change, if `\u03c6 : F \u27f6 G` is a\nmorphism of towers that have limits such that `F 0 \u27f6 G 0` and every comparison map\n`F (n + 1) \u27f6 F n \u00d7_{G n} G (n + 1)` are epimorphisms, then `limMap \u03c6 : limit F \u27f6 limit G` is an\nepimorphism. -/\ntheorem epi_limMap [HasLimit F] [HasLimit G] (h\u2080 : Epi (\u03c6.app \u27e80\u27e9))\n (h : \u2200 n, Epi (pullback.lift (F.map (homOfLE (Nat.le_succ n)).op) (\u03c6.app \u27e8n + 1\u27e9)\n (\u03c6.naturality _))) :\n Epi (limMap \u03c6) :=\n epi_isLimitMap \u03c6 (limit.isLimit G) (limit.isLimit F) h\u2080 h\n\nend Map\n\nsection Products\n\nvariable [IsReplete C] [HasCountableProducts C]\n [(MorphismProperty.epimorphisms C).IsStableUnderBaseChange]\n\nopen SequentialProduct in\n/-- The case `\u03b1 = \u2115` of `TauCeti.IsReplete.epi_pi_map`: `\u220f f` is the first projection of the limit\nof the tower `\u220f_{m < n} X m \u00d7 \u220f_{m \u2265 n} Y m`, whose transition maps apply one `f n` at a time.\nThe argument generalizes Mathlib's proof for light condensed modules in\n`Mathlib.Condensed.Light.Epi` (Dagur Asgeirsson) to replete categories. -/\nprivate theorem epi_pi_map_nat {X Y : \u2115 \u2192 C} (f : \u2200 n, X n \u27f6 Y n) [\u2200 n, Epi (f n)] :\n Epi (Limits.Pi.map f) := by\n have hF (n : \u2115) :\n Epi ((Functor.ofOpSequence (functorMap f)).map (homOfLE (Nat.le_succ n)).op) := by\n rw [Functor.ofOpSequence_map_homOfLE_succ]\n refine MorphismProperty.of_isPullback (P := MorphismProperty.epimorphisms C)\n (IsPullback.of_pi_map_of_isIso _ n fun m hm \u21a6 ?_) ?_\n \u00b7 by_cases h : m < n\n \u00b7 simp only [h, \u2193reduceDIte]\n infer_instance\n \u00b7 simp only [h, \u2193reduceDIte, show \u00acm < n + 1 by omega]\n infer_instance\n \u00b7 simp only [lt_irrefl, \u2193reduceDIte, Nat.lt_succ_self, MorphismProperty.epimorphisms.iff]\n infer_instance\n -- The first projection of the limit cone is `\u220f f`, followed by the identification of\n -- `\u220f_{m \u2265 0} Y m` with `\u220f Y`: the type ascription unfolds `SequentialProduct.cone`, as in\n -- `SequentialProduct.cone_\u03c0_app` (proved by `rfl`), since rewriting along that lemma would\n -- leave the cone's own objects in the statement.\n have h\u2080 : Epi (Limits.Pi.map fun m \u21a6 if h : m < 0 then eqToHom (functorObj_eq_pos h).symm else\n f m \u226b eqToHom (functorObj_eq_neg h).symm) :=\n epi_\u03c0_app_zero hF (isLimit f)\n have e : (Limits.Pi.map fun m \u21a6 if h : m < 0 then eqToHom (functorObj_eq_pos h).symm else\n f m \u226b eqToHom (functorObj_eq_neg h).symm) = Limits.Pi.map f \u226b\n Limits.Pi.map fun m \u21a6 eqToHom (functorObj_eq_neg (Nat.not_lt_zero m)).symm := by\n rw [Limits.Pi.map_comp_map]\n simp\n rw [e] at h\u2080\n exact (epi_comp_iff_of_isIso _ (Limits.Pi.map fun m \u21a6\n eqToHom (functorObj_eq_neg (M := X) (N := Y) (Nat.not_lt_zero m)).symm)).1 h\u2080\n\n", "statement": "/-- **Countable products of epimorphisms in a replete category** (Bhatt\u2013Scholze, Proposition\n3.1.9). In a replete category with countable products, in which epimorphisms are stable under base\nchange, a countable product of epimorphisms is an epimorphism. -/\ntheorem epi_pi_map {\u03b1 : Type} [Countable \u03b1] {X Y : \u03b1 \u2192 C} (f : \u2200 a, X a \u27f6 Y a)\n [\u2200 a, Epi (f a)] : Epi (Limits.Pi.map f) ", "proof": " by\n rcases isEmpty_or_nonempty \u03b1 with h\u03b1 | h\u03b1\n \u00b7 -- Both products are empty, and `\u220f X \u27f6 \u220f Y` has a section.\n exact (IsSplitEpi.mk' \u27e8Pi.lift fun a \u21a6 isEmptyElim a, Pi.hom_ext _ _ fun a \u21a6 isEmptyElim a\u27e9).epi\n -- Reindex along a surjection `s : \u2115 \u2192 \u03b1` with a section `t`. The retraction\n -- `r X : \u220f (X \u2218 s) \u27f6 \u220f X`, picking the factor `t a` for `a`, satisfies\n -- `r X \u226b \u220f f = \u220f (f \u2218 s) \u226b r Y`, and `r Y` is a split epimorphism.\n obtain \u27e8s, hs\u27e9 := exists_surjective_nat \u03b1\n choose t ht using hs\n let r (Z : \u03b1 \u2192 C) : \u220f\u1d9c (fun n \u21a6 Z (s n)) \u27f6 \u220f\u1d9c Z :=\n Pi.lift fun a \u21a6 Pi.\u03c0 (fun n \u21a6 Z (s n)) (t a) \u226b eqToHom (congrArg Z (ht a))\n have hr (Z : \u03b1 \u2192 C) (a : \u03b1) :\n r Z \u226b Pi.\u03c0 Z a = Pi.\u03c0 (fun n \u21a6 Z (s n)) (t a) \u226b eqToHom (congrArg Z (ht a)) :=\n Pi.lift_comp_\u03c0 _ _\n have hnat : r X \u226b Limits.Pi.map f = Limits.Pi.map (fun n \u21a6 f (s n)) \u226b r Y := by\n refine Pi.hom_ext _ _ fun a \u21a6 ?_\n simp [hr, reassoc_of% hr, eqToHom_naturality f (ht a)]\n have : IsSplitEpi (r Y) := IsSplitEpi.mk' \u27e8Pi.lift fun n \u21a6 Pi.\u03c0 Y (s n),\n Pi.hom_ext _ _ fun a \u21a6 by simpa [hr] using Pi.\u03c0_comp_eqToHom Y (ht a)\u27e9\n have := epi_pi_map_nat fun n \u21a6 f (s n)\n have : Epi (r X \u226b Limits.Pi.map f) := by\n rw [hnat]\n infer_instance\n exact epi_of_epi (r X) _", "proof_lines": 23, "proof_length": 902, "rev": "75c8aed5fea63047615a25a9763fd5b68a86e891", "heartbeats": 1873, "image": "lean-compression:tauceti-75c8aed5fe-a608030cfc", "split": "dev"} {"path": "TauCeti/NumberTheory/LFunctions/Grossencharacter/Conductor.lean", "module": "TauCeti.NumberTheory.LFunctions.Grossencharacter.Conductor", "theorem": "TauCeti.LFunctions.Grossencharacter.unitaryWeight_eq_restrictAway", "prefix": "/-\nCopyright (c) 2026 The Tau Ceti contributors. All rights reserved.\nReleased under Apache 2.0 license as described in the file LICENSE.\nAuthors: The Tau Ceti contributors\n-/\nmodule\n\npublic import Mathlib.NumberTheory.LSeries.RiemannZeta\npublic import TauCeti.NumberTheory.LFunctions.DedekindZeta.Basic\npublic import TauCeti.NumberTheory.LFunctions.Grossencharacter.Basic\npublic import TauCeti.NumberTheory.NumberField.Global.HeckeCharacter.UnitaryWeight\nimport TauCeti.Analysis.SpecialFunctions.Pow.EulerFactor\nimport TauCeti.NumberTheory.ArithmeticDirichletSeries.EulerProduct.Restrict\nimport TauCeti.NumberTheory.LFunctions.DedekindZeta.Rat\nimport TauCeti.NumberTheory.NumberField.Global.HeckeCharacter.RealParity\nimport TauCeti.RingTheory.DedekindDomain.AdicValuation.Completion\n\n/-!\n# The presentation conductor, primitive reduction, and norm-power Grossencharacters\n\nOne algebraic Hecke character of a number field `K` can be presented (`Grossencharacter K \ud835\udd2a`) at\nevery modulus `\ud835\udd2a` that clears both its finite ramification and the real sign mismatches between its\narchimedean restriction and its algebraic infinity type. This file identifies the least such\nmodulus, constructs the primitive presentation there and the induced presentations at its\nmultiples, compares their L-functions by the deleted Euler factors, relates finite-order\npresentations to ray class characters, and builds the integral norm-power presentations `N ^ m`.\n\n## The presentation conductor\n\nFor a presentation `\u03c7 : Grossencharacter K \ud835\udd2a`, `\u03c7.conductor` is the modulus whose finite part is\n`\u03c7.toHeckeCharacter.finiteConductor` (`\u220f_v v ^ a_v(\u03c7)`) and whose infinite part consists of the\nreal places `w` at which the parity `\u03c7.toHeckeCharacter.infinityType.realParity w` of the\narchimedean restriction differs from\n`(AlgebraicInfinityType.toContinuous \u03c7.infinityType).realParity w`.\n\nAt a real place, this is the conductor of the **presentation**, not the ramification conductor of\nthe idele class character: the odd norm powers `N ^ m = \u2016\u00b7\u2016 ^ (-m)` (`Grossencharacter.normPow`)\nhave archimedean component `x \u21a6 |x| ^ (-m)` trivial on `\u00b11`, yet every real place divides their\npresentation conductor (`Grossencharacter.conductor_normPow_of_odd`) because their algebraic\nexponent `-m` is odd while `realParity_eq` forbids an unrecorded parity mismatch outside the\nmodulus. For a character of finite order the algebraic infinity type is `0`, the two notions agree,\nand `Grossencharacter.conductor` equals `HeckeCharacter.conductor`\n(`Grossencharacter.conductor_eq_heckeCharacter_conductor`).\n\nA modulus `\ud835\udd2b` presents `\u03c7.toHeckeCharacter` if and only if `\u03c7.conductor \u2223 \ud835\udd2b`\n(`Grossencharacter.conductor_dvd_iff`). In particular, `\u03c7.primitive` is the canonical presentation\nat `\u03c7.conductor`, with unitary weight `\u03c7.toHeckeCharacter.unitaryIdealWeight`, and every algebraic\nHecke character admits a presentation at some modulus\n(`Grossencharacter.exists_grossencharacter_iff_isAlgebraic`).\n\n## Imprimitive Euler factors\n\nPresenting `\u03c7` at a multiple `\ud835\udd2b` of `\ud835\udd2a` restricts its unitary weight away from `\ud835\udd2b.support`,\nmultiplying its L-series on `Re s > 1 + \u03c7.idealShift` and the punctured germs of `lFunctionC` at\nevery point of `\u2102` by the entire product\n`Grossencharacter.eulerCorrection \u03c7 \ud835\udd2b s = \u220f_{\ud835\udd2d \u2223 \ud835\udd2b, \ud835\udd2d \u2224 \ud835\udd2a} (1 - \u03c7_u(\ud835\udd2d) N\ud835\udd2d ^ (idealShift - s))`,\nwhose zeros lie on the vertical line `Re s = \u03c7.idealShift`.\n\n## Main definitions\n\n* `TauCeti.LFunctions.Grossencharacter.conductor`: the least modulus presenting `\u03c7`.\n* `TauCeti.LFunctions.Grossencharacter.changeModulus`: the presentation of `\u03c7` at any multiple of\n `\u03c7.conductor`.\n* `TauCeti.LFunctions.Grossencharacter.primitive`: the canonical presentation at `\u03c7.conductor`.\n* `TauCeti.LFunctions.Grossencharacter.eulerCorrection`: the Euler factors deleted when passing to\n a larger modulus.\n* `TauCeti.LFunctions.Grossencharacter.normPow`: the presentation at `narrowModulus K` of the\n integral norm power `\u2016\u00b7\u2016 ^ (-m)` (`m : \u2124`), with ideal-side shift `m` and L-function\n `dedekindZetaC K (s - m)` (`riemannZeta (s - m)` over `\u211a` away from `s = 1 + m`).\n\n## Main results\n\n* `TauCeti.LFunctions.Grossencharacter.conductor_dvd_iff`: `\u03c7.conductor \u2223 \ud835\udd2b` iff\n `\u03c7.toHeckeCharacter` admits a presentation at `\ud835\udd2b`.\n* `TauCeti.LFunctions.Grossencharacter.exists_grossencharacter_iff_isAlgebraic`: a Hecke character\n admits a `Grossencharacter` presentation iff it is algebraic.\n* `TauCeti.LFunctions.Grossencharacter.lFunctionC_eq_primitive` and\n `TauCeti.LFunctions.Grossencharacter.lFunctionC_eventuallyEq_primitive`: every presented\n L-function is the primitive L-function times the deleted Euler factors, on\n `Re s > 1 + \u03c7.idealShift` and as punctured germs everywhere.\n* `TauCeti.LFunctions.Grossencharacter.conductor_eq_heckeCharacter_conductor` and\n `TauCeti.LFunctions.Grossencharacter.isFiniteOrder_iff_mem_range_ofRayClassCharacter`:\n finite-order presentations and ray class characters.\n* `TauCeti.LFunctions.Grossencharacter.conductor_normPow_of_even`,\n `TauCeti.LFunctions.Grossencharacter.conductor_normPow_of_odd`, and\n `TauCeti.LFunctions.Grossencharacter.not_exists_grossencharacter_one_normPow_of_odd`: parity\n dichotomy for `normPow K m` and non-presentability at the trivial modulus when `m` is odd and `K`\n has a real place.\n* `TauCeti.LFunctions.Grossencharacter.lFunctionC_normPow` and\n `TauCeti.LFunctions.Grossencharacter.lFunctionC_normPow_rat`: the L-function of `normPow`.\n\n## References\n\n* J. Neukirch, *Algebraic Number Theory*, Chapter VII, \u00a76 and \u00a78.\n* A. Weil, *Basic Number Theory*, Chapter VII, \u00a73.\n-/\n\npublic section\nnoncomputable section\n\nopen Filter Set IsDedekindDomain NumberField\nopen scoped NumberField NNReal Topology\n\nnamespace TauCeti.LFunctions\n\nopen GlobalNumberFields\n\nvariable {K : Type*} [Field K] [NumberField K]\n\nnamespace Grossencharacter\n\nvariable {\ud835\udd2a \ud835\udd2b : Modulus K}\n\n/-! ### The unitary weight of a presentation -/\n\n", "statement": "/-- **The unitary weight of any presentation at `\ud835\udd2a` is the primitive unitary ideal weight of its\nHecke character restricted away from `\ud835\udd2a.support`.** -/\ntheorem unitaryWeight_eq_restrictAway (\u03c7 : Grossencharacter K \ud835\udd2a) :\n \u03c7.unitaryWeight =\n \u03c7.toHeckeCharacter.unitaryIdealWeight.restrictAway \ud835\udd2a.support \ud835\udd2a.support.finite_toSet ", "proof": " by\n classical\n refine Subtype.ext (MultiplicativeIdealWeight.ext_heightOneSpectrum fun v \u21a6 ?_)\n by_cases hv : v.asIdeal \u2223 \ud835\udd2a.finitePart\n \u00b7 have hmem : v \u2208 \ud835\udd2a.support := (\ud835\udd2a.mem_support_iff v).mpr hv\n have hbad : \u00ac Ideal.IsPrimeTo v.asIdeal \ud835\udd2a.support :=\n fun hg \u21a6 (Ideal.isPrimeTo_asIdeal_iff.mp hg) (by simpa using hmem)\n rw [\u03c7.unitaryWeight_apply_of_dvd hv, UnitaryIdealWeight.val_restrictAway,\n MultiplicativeIdealWeight.restrictAway_apply]\n simp [hbad]\n \u00b7 have hnot : v \u2209 \ud835\udd2a.support := (\ud835\udd2a.mem_support_iff v).not.mpr hv\n have hgood : Ideal.IsPrimeTo v.asIdeal \ud835\udd2a.support := Ideal.isPrimeTo_asIdeal_iff.mpr hnot\n have hndvd : \u00ac v.asIdeal \u2223 \u03c7.toHeckeCharacter.finiteConductor :=\n fun hdvd \u21a6 hv (hdvd.trans \u03c7.finiteConductor_dvd_finitePart)\n obtain \u27e8u, hu\u27e9 := v.exists_unit_valued_eq_exp K (-1)\n rw [\u03c7.unitaryWeight_apply v hv u hu, UnitaryIdealWeight.val_restrictAway,\n MultiplicativeIdealWeight.restrictAway_apply,\n ite_eq_left_iff.mpr fun h \u21a6 (h hgood).elim,\n HeckeCharacter.unitaryIdealWeight_apply_prime _ v hndvd u hu]", "proof_lines": 18, "proof_length": 1000, "rev": "75c8aed5fea63047615a25a9763fd5b68a86e891", "heartbeats": 591, "image": "lean-compression:tauceti-75c8aed5fe-a608030cfc", "split": "dev"} {"path": "TauCeti/NumberTheory/LSeries/WienerIkehara/BoundaryGrowth.lean", "module": "TauCeti.NumberTheory.LSeries.WienerIkehara.BoundaryGrowth", "theorem": "TauCeti.LSeries.tsum_norm_term_le_of_boundary", "prefix": "/-\nCopyright (c) 2026 The Tau Ceti contributors. All rights reserved.\nReleased under Apache 2.0 license as described in the file LICENSE.\nAuthors: The Tau Ceti contributors\n-/\nmodule\n\nimport TauCeti.NumberTheory.LSeries.Positivity\npublic import TauCeti.Analysis.Fourier.Decay\npublic import TauCeti.NumberTheory.LSeries.Summable\npublic import TauCeti.NumberTheory.LSeries.WienerIkehara.Asymptotic\n\n/-!\n# A growth bound for nonnegative coefficients, and the summability it supplies\n\nThe smoothed Wiener--Ikehara asymptotic\n`TauCeti.LSeries.tendsto_tsum_term_mul_fourier_atTop` still carries a summability hypothesis: the\nFourier-weighted series `\u2211 a n \ud835\udcd5 psi (log (n / x) / 2\u03c0) / n` has to converge on the boundary line\n`Re s = 1`, where the coefficients are no longer damped by `n ^ (-(sigma - 1))`. This file removes\nthat hypothesis for nonnegative coefficients, which is the only case Wiener--Ikehara is about.\n\nThe inputs are coefficient nonnegativity, the boundary remainder data on the real segment\n`sigma \u2208 (1, 2]`, and convergence of the Dirichlet series on that segment (`hsum` below, which\nthe boundary data do not supply). The growth bound for the partial sums is derived from these\ninputs, not assumed.\nNonnegativity turns the boundary data into the one-sided estimate\n`\u2211 \u2016a n\u2016 / n ^ sigma \u2264 B / (sigma - 1)` on `(1, 2]`, and inserting\n`sigma = 1 + 1 / log t` into it bounds `\u2211_{n \u2264 t} \u2016a n\u2016` by a multiple of `t log t`. That is weaker\nthan the Chebyshev bound `O(t)` which Wiener--Ikehara ultimately proves, but it is available before\nany Tauberian argument, and one logarithm to spare is all the summability needs: the Fourier\ntransform of a smooth compactly supported function decays faster than `|v| ^ (-3)`, so the factor\nattached to `a n` is `O((log n) ^ (-3))`, and the Abel-summation bound\n`TauCeti.LSeries.LSeriesSummable_mul_of_norm_le` converts `O(t log t)` partial sums into a\nconvergent series.\n\nOnly the values of the boundary remainder on the real segment `sigma \u2208 (1, 2]` enter the growth\nbound, so the results below are stated with the boundary data restricted to that segment; the final\nasymptotic specializes the half-plane hypotheses it inherits from\n`TauCeti.LSeries.tendsto_tsum_term_mul_fourier_atTop_of_contDiff`.\n\n## Main results\n\n* `TauCeti.LSeries.tsum_norm_term_le_of_boundary`: for nonnegative coefficients with a boundary\n remainder continuous on the segment `[1, 2]`, the norm series, assumed convergent on `(1, 2]`,\n satisfies `\u2211 \u2016term a sigma n\u2016 \u2264 B / (sigma - 1)` there.\n* `TauCeti.LSeries.isBigO_sum_Icc_norm_of_boundary`: the resulting `O(t log t)` bound for the\n partial sums.\n* `TauCeti.LSeries.LSeriesSummable_mul_fourier_of_nonneg`: the Fourier weight is small enough for\n that bound to force summability at `s = 1`, at every scale `x > 0`.\n* `TauCeti.LSeries.tendsto_tsum_term_mul_fourier_atTop_of_nonneg`: **the smoothed Wiener--Ikehara\n asymptotic for nonnegative coefficients**, with the Fourier-weighted summability hypothesis\n discharged; besides the boundary data, the convergence of the Dirichlet series for real\n `sigma > 1` is still assumed.\n\n## References\n\n* J. Korevaar, *Tauberian Theory: A Century of Developments*, Chapter III.\n* G. Tenenbaum, *Introduction to Analytic and Probabilistic Number Theory*, Chapter II.\n-/\n\npublic section\n\nnamespace TauCeti.LSeries\n\nopen Asymptotics Complex Filter FourierTransform MeasureTheory Real Set\nopen scoped ComplexOrder ContDiff Topology\n\nvariable {a : \u2115 \u2192 \u2102} {A : \u2102} {G : \u2102 \u2192 \u2102} {psi : \u211d \u2192 \u2102} {x : \u211d}\n\n/-! ### The one-sided bound coming from the boundary data -/\n\n", "statement": "/-- For nonnegative coefficients, a boundary remainder `G` continuous on the real segment `[1, 2]`\nbounds the Dirichlet series on `(1, 2]` by `B / (sigma - 1)`: the remainder is bounded on the\ncompact segment, and the pole term contributes `\u2016A\u2016 / (sigma - 1)`.\n\nNo analytic continuation is used, only the values of `G` on that segment and the identity\n`G = LSeries a - A / (s - 1)` on its interior, together with the summability hypothesis `hsum` of\nthe Dirichlet series on `(1, 2]`, which supplies the `Summable` conjunct of the conclusion. -/\ntheorem tsum_norm_term_le_of_boundary (ha : 0 \u2264 a)\n (hG : ContinuousOn (fun sigma : \u211d \u21a6 G (sigma : \u2102)) (Icc 1 2))\n (hG' : \u2200 sigma : \u211d, 1 < sigma \u2192 sigma \u2264 2 \u2192\n G (sigma : \u2102) = LSeries a (sigma : \u2102) - A / ((sigma : \u2102) - 1))\n (hsum : \u2200 sigma : \u211d, 1 < sigma \u2192 sigma \u2264 2 \u2192 LSeriesSummable a (sigma : \u2102)) :\n \u2203 B : \u211d, 0 \u2264 B \u2227 \u2200 sigma : \u211d, 1 < sigma \u2192 sigma \u2264 2 \u2192\n Summable (fun n : \u2115 \u21a6 \u2016_root_.LSeries.term a (sigma : \u2102) n\u2016) \u2227\n \u2211' n : \u2115, \u2016_root_.LSeries.term a (sigma : \u2102) n\u2016 \u2264 B / (sigma - 1) ", "proof": " by\n obtain \u27e8M, hM\u27e9 := isCompact_Icc.exists_bound_of_continuousOn hG\n have hM0 : 0 \u2264 M := le_trans (norm_nonneg _) (hM 1 \u27e8le_rfl, one_le_two\u27e9)\n refine \u27e8M + \u2016A\u2016, by positivity, fun sigma h1 h2 \u21a6\n \u27e8summable_norm_iff.mpr (hsum sigma h1 h2), ?_\u27e9\u27e9\n have hsub : (sigma : \u2102) - 1 = ((sigma - 1 : \u211d) : \u2102) := by push_cast; ring\n have hnorm : \u2016A / ((sigma : \u2102) - 1)\u2016 = \u2016A\u2016 / (sigma - 1) := by\n rw [hsub, norm_div, Complex.norm_real, Real.norm_of_nonneg (by linarith)]\n have hnn : (0 : \u211d) \u2264 \u2211' n : \u2115, \u2016_root_.LSeries.term a (sigma : \u2102) n\u2016 :=\n tsum_nonneg fun _ \u21a6 norm_nonneg _\n have hS : ((\u2211' n : \u2115, \u2016_root_.LSeries.term a (sigma : \u2102) n\u2016 : \u211d) : \u2102) =\n G (sigma : \u2102) + A / ((sigma : \u2102) - 1) := by\n rw [\u2190 LSeries_eq_ofReal_tsum_norm_of_nonneg ha sigma, hG' sigma h1 h2]\n ring\n have hMdiv : M \u2264 M / (sigma - 1) := by\n rw [le_div_iff\u2080 (by linarith : (0 : \u211d) < sigma - 1)]\n nlinarith\n have hkey : \u2211' n : \u2115, \u2016_root_.LSeries.term a (sigma : \u2102) n\u2016 \u2264 M + \u2016A\u2016 / (sigma - 1) := by\n calc \u2211' n : \u2115, \u2016_root_.LSeries.term a (sigma : \u2102) n\u2016\n = \u2016((\u2211' n : \u2115, \u2016_root_.LSeries.term a (sigma : \u2102) n\u2016 : \u211d) : \u2102)\u2016 := by\n rw [Complex.norm_real, Real.norm_of_nonneg hnn]\n _ \u2264 \u2016G (sigma : \u2102)\u2016 + \u2016A / ((sigma : \u2102) - 1)\u2016 := by rw [hS]; exact norm_add_le _ _\n _ \u2264 M + \u2016A\u2016 / (sigma - 1) := by\n rw [hnorm]\n gcongr\n exact hM sigma \u27e8h1.le, h2\u27e9\n rw [add_div]\n linarith", "proof_lines": 27, "proof_length": 1291, "rev": "75c8aed5fea63047615a25a9763fd5b68a86e891", "heartbeats": 2976, "image": "lean-compression:tauceti-75c8aed5fe-a608030cfc", "split": "dev"} {"path": "TauCeti/Geometry/Manifold/VectorBundle/Tensoriality.lean", "module": "TauCeti.Geometry.Manifold.VectorBundle.Tensoriality", "theorem": "TauCeti.Manifold.map_sum_eq_of_contMDiff_additive", "prefix": "/-\nCopyright (c) 2026 The Tau Ceti contributors. All rights reserved.\nReleased under Apache 2.0 license as described in the file LICENSE.\nAuthors: The Tau Ceti contributors\n-/\nmodule\n\npublic import Mathlib.Geometry.Manifold.VectorBundle.Tensoriality\npublic import Mathlib.Topology.Algebra.Module.Multilinear.Basic\nimport Mathlib.Geometry.Manifold.Algebra.Structures\nimport Mathlib.Geometry.Manifold.BumpFunction\nimport Mathlib.Geometry.Manifold.VectorBundle.ContMDiffSection\nimport TauCeti.Geometry.Manifold.BumpFunction\nimport TauCeti.Geometry.Manifold.VectorBundle.LocalFrame\nimport TauCeti.Topology.Algebra.Module.FiniteDimension\n\n/-!\n# Tensoriality of globally `C^n` operations\n\nThis file complements Mathlib's pointwise tensoriality API with a criterion for operations whose\nadditivity and `C^n`-function linearity laws are available for globally `C^n` sections.\nThe criterion applies to finite-rank `C^n` real vector bundles (`n \u2264 \u221e`) over\nfinite-dimensional Hausdorff `C^n` manifolds; on a trivial bundle the constant sections form a\nglobal frame, and no hypothesis on the base is needed. The target only needs addition and scalar\nmultiplication; no algebraic laws on these operations are required beyond the stated laws for the\nsection operation.\n\n## Main results\n\n* `TauCeti.Manifold.eq_of_contMDiff_smul_of_eventuallyEq`: `C^n`-function linearity (`n \u2264 \u221e`)\n implies locality.\n* `TauCeti.Manifold.eq_of_contMDiff_tensorial`: an operation satisfying these laws for `n \u2264 \u221e`\n has equal values on globally `C^n` sections which agree at the point of evaluation.\n* `TauCeti.Manifold.eq_zero_of_contMDiff_tensorial_of_const`: on the trivial bundle with\n finite-dimensional fibre, an operation satisfying these laws and vanishing on constant sections\n vanishes, over any base.\n\nIt also extends Mathlib's two-argument criterion `TensorialAt.mkHom\u2082` to operations on families\nof sections indexed by a finite type `\u03b9`, as needed for tensors with several arguments:\n\n* `TensorialAt.pointwise_pi`: an operation which is tensorial at `x` in each argument, while the\n other arguments are differentiable at `x`, depends only on the values of the arguments at `x`.\n* `TensorialAt.mkMultilinear`: such an operation is a continuous multilinear map on the fibre at\n `x`, with evaluation rule `TensorialAt.mkMultilinear_apply`.\n-/\n\npublic section\n\nopen Bundle FiberBundle Module\nopen scoped ContDiff Manifold Topology\n\nnoncomputable section\n\nnamespace TauCeti.Manifold\n\n", "statement": "/-- An operation on sections which is additive on globally `C^n` sections takes equal values on\ntwo finite sums of globally `C^n` sections whenever it takes equal values on the summands. The\ntarget needs only an addition, without any algebraic laws. -/\ntheorem map_sum_eq_of_contMDiff_additive\n {\ud835\udd5c : Type*} [NontriviallyNormedField \ud835\udd5c] {n : \u2115\u221e\u03c9}\n {E : Type*} [NormedAddCommGroup E] [NormedSpace \ud835\udd5c E]\n {H : Type*} [TopologicalSpace H] {I : ModelWithCorners \ud835\udd5c E H}\n {M : Type*} [TopologicalSpace M] [ChartedSpace H M]\n {G : Type*} [NormedAddCommGroup G] [NormedSpace \ud835\udd5c G]\n {W : M \u2192 Type*} [TopologicalSpace (TotalSpace G W)]\n [\u2200 x, AddCommGroup (W x)] [\u2200 x, Module \ud835\udd5c (W x)] [\u2200 x, TopologicalSpace (W x)]\n [FiberBundle G W] [VectorBundle \ud835\udd5c G W]\n {A : Type*} [Add A] (\u03a6 : (\u03a0 x : M, W x) \u2192 A)\n (hadd : \u2200 {s s' : \u03a0 x : M, W x}, CMDiff n (T% s) \u2192 CMDiff n (T% s') \u2192\n \u03a6 (s + s') = \u03a6 s + \u03a6 s')\n {\u03b9 : Type*} (q : Finset \u03b9) (u v : \u03b9 \u2192 \u03a0 x : M, W x)\n (hu : \u2200 i \u2208 q, CMDiff n (T% (u i))) (hv : \u2200 i \u2208 q, CMDiff n (T% (v i)))\n (huv : \u2200 i \u2208 q, \u03a6 (u i) = \u03a6 (v i)) :\n \u03a6 (\u2211 i \u2208 q, u i) = \u03a6 (\u2211 i \u2208 q, v i) ", "proof": " by\n classical\n induction q using Finset.induction_on with\n | empty => simp only [Finset.sum_empty]\n | @insert i q hi ih =>\n rw [Finset.forall_mem_insert] at hu hv huv\n -- Partial sums of globally `C^n` sections are globally `C^n`.\n have hsum {w : \u03b9 \u2192 \u03a0 x : M, W x} (hw : \u2200 j \u2208 q, CMDiff n (T% (w j))) :\n CMDiff n (T% (\u2211 j \u2208 q, w j)) := by\n simpa only [Finset.sum_apply] using ContMDiff.sum_section hw\n simp only [Finset.sum_insert hi]\n rw [hadd hu.1 (hsum hu.2), hadd hv.1 (hsum hv.2), huv.1, ih hu.2 hv.2 huv.2]", "proof_lines": 11, "proof_length": 438, "rev": "75c8aed5fea63047615a25a9763fd5b68a86e891", "heartbeats": 960, "image": "lean-compression:tauceti-75c8aed5fe-a608030cfc", "split": "dev"} {"path": "TauCeti/NumberTheory/ModularForms/Norm/Valence.lean", "module": "TauCeti.NumberTheory.ModularForms.Norm.Valence", "theorem": "TauCeti.ModularForm.finsum_weightedOrderOfVanishingOnSubgroupOrbit_eq_finsum_norm", "prefix": "/-\nCopyright (c) 2026 The Tau Ceti contributors. All rights reserved.\nReleased under Apache 2.0 license as described in the file LICENSE.\nAuthors: The Tau Ceti contributors\n-/\nmodule\n\npublic import TauCeti.NumberTheory.ModularForms.LevelOne.ValenceFormula\npublic import TauCeti.NumberTheory.ModularForms.Order.SubgroupOrbits\n\n/-!\n# The valence formula at general level, transported along the norm map\n\nFor a finite-index subgroup `\u0393 \u2264 SL(2, \u2124)`, the norm `ModularForm.norm \ud835\udcae\u2112 f = \u220f_{\u03b3 \u2208 SL(2, \u2124) / \u0393}\nf \u2223[k] \u03b3` of a weight-`k` form on `\u0393` is a level-one form of weight `k \u00b7 [SL(2, \u2124) : \u0393]`, and its\ndivisor is the `\u0393`-divisor of `f` pushed forward. This file carries out that push-forward on the\n**interior** of the upper half-plane and reads the level-one valence formula back as the\ngeneral-level one:\n\n`\u03a3_{P \u2208 \u0393 \\ \u210d} (2 / |Stab_\u0393 P|) \u00b7 ord_P f + ord_\u221e(Nm f) = k \u00b7 [SL(2, \u2124) : \u0393] / 12`.\n\nThe bookkeeping is the orbit\u2013stabiliser count already available in\n`TauCeti.card_fiber_orbitOfCosetTranslate_mul_cardStabilizerOnOrbit`: the cosets of `\u0393` that\ntranslate a point `p` into a given `\u0393`-orbit `P` number `|Stab_{SL(2, \u2124)} p| / |Stab_\u0393 P|`, and\n`|Stab_{SL(2, \u2124)} p| = 2 \u00b7 e_p` is twice the level-one elliptic order. Dividing the count by `e_p`\ntherefore turns the level-one weight `1 / e_p` into the general-level weight `2 / |Stab_\u0393 P|`,\nuniformly in `P`, with no case split on the elliptic points.\n\nThe index is the **full** coset index `[SL(2, \u2124) : \u0393]`, not the projective one, and correspondingly\nthe weight is read on the matrix stabiliser rather than on the projective order `e_P`. That is the\nonly choice under which both sides are correct in odd weight with `-I \u2209 \u0393`, where the projective\nnorm is not even well defined; the projective statement\n`\u03a3_P (1 / e_P) \u00b7 ord_P f + (|{\u00b1I} \u2229 \u0393| / 2) \u00b7 ord_\u221e(Nm f) =\n k \u00b7 [SL(2, \u2124) : \u00b1\u0393] / 12` is obtained by multiplying this identity by\n`|{\u00b1I} \u2229 \u0393| / 2`. See\n`TauCeti.ModularForm.weightedOrderOfVanishingOnSubgroupOrbit`.\n\n## Main declarations\n\n* `TauCeti.ModularForm.weightedOrderOfVanishingOnSubgroupOrbit`: the general-level weighted\n vanishing order `2 \u00b7 ord_P f / |Stab_\u0393 P|`, with\n `TauCeti.ModularForm.weightedOrderOfVanishingOnOrbit_eq_two_mul_div` identifying the level-one\n weight `ord_P f / e_P` as the same expression.\n* `TauCeti.ModularForm.weightedOrderOfVanishingOnOrbit_norm_eq_finsum_mem`: the local\n redistribution \u2014 the level-one weight of the norm at one `SL(2, \u2124)`-orbit is the sum of the\n general-level weights of `f` over the `\u0393`-orbits inside it.\n* `TauCeti.ModularForm.finsum_weightedOrderOfVanishingOnSubgroupOrbit_eq_finsum_norm`: the global\n form of the same statement, the two divisor sums being equal.\n* `valence_formula_finiteIndex_norm`: **the norm-intermediate general-level valence formula**,\n with the cusp term still read at level one on the norm.\n* `twentyFour_mul_orderOfVanishingOnSubgroupOrbit_le_weight_mul_index_mul_cardStabilizer`\n and\n `orderOfVanishingOnSubgroupOrbit_eq_zero_of_weight_mul_index_mul_cardStabilizer_lt_twentyFour`:\n the single-orbit consequences, bounding the mass at one orbit by the total.\n\n## Implementation notes\n\nThe **cusp** half \u2014 distributing `ord_\u221e(Nm f)` over the cusps of `\u0393`, each read in its width\nparameter \u2014 is carried out in `Norm/Cusps.lean`, which combines it with the identity below into\nthe full general-level valence formula `TauCeti.ModularForm.valence_formula_finiteIndex`. The\nnorm is decomposed orbitwise by\n`TauCeti.ModularForm.slashInvariantForm_norm_apply_eq_prod_galoisProd`, and the resulting orders\nare summed in\n`TauCeti.ModularForm.qExpansionOrderAtCusp_one_norm_eq_sum_orderAtCuspTranslationOrbit`.\n\n## References\n\n* [F. Diamond and J. Shurman, *A first course in modular forms*][diamondshurman2005], \u00a73.\n* [AINTLIB `LeanModularForms`](https://github.com/CBirkbeck/AINTLIB) \u2014 the norm-map route to\n general level, used there for the finite-index Sturm bound (`dim_gen_cong_levels`); the\n redistribution of the *exact* level-one identity carried out here is new.\n-/\n\npublic section\n\nopen UpperHalfPlane MulAction\n\nopen scoped ModularForm MatrixGroups Modular\n\nnamespace TauCeti\n\nnamespace ModularForm\n\nvariable {\u0393 : Subgroup SL(2, \u2124)} {k : \u2124} {F : Type*} [FunLike F \u210d \u2102]\n\n/-- **The weighted vanishing order of a form on a `\u0393`-orbit**: `2 \u00b7 ord_P f / |Stab_\u0393 P|`, the\nsummand of the valence formula at general level.\n\nThe weight is written through the **matrix** stabiliser order, not through the projective one:\n`Nat.card (stabilizer \u0393 P) = Nat.card ((center SL(2, \u2124)).subgroupOf \u0393) * e_P` by\n`TauCeti.card_stabilizer_eq_card_subgroupOf_mul_card_stabilizer_map`, so the weight is `1 / e_P`\nwhen `-I \u2208 \u0393` and `2 / e_P` when `-I \u2209 \u0393`. That is the right normalisation for the norm map,\nwhose weight is `k \u00b7 [SL(2, \u2124) : \u0393]` for the **full** coset index: both sides of the general-level\nformula double when `-I \u2209 \u0393`, and dividing by `2` there recovers the projective statement\n`\u2211_P (1 / e_P) \u00b7 ord_P f + (|{\u00b1I} \u2229 \u0393| / 2) \u00b7 ord_\u221e(Nm f) =\n k \u00b7 [SL(2, \u2124) : \u00b1\u0393] / 12`.\n\nAt level one this is the same weight: `weightedOrderOfVanishingOnOrbit_eq_two_mul_div` below. -/\nnoncomputable def weightedOrderOfVanishingOnSubgroupOrbit\n [SlashInvariantFormClass F (\u0393 : Subgroup (GL (Fin 2) \u211d)) k] (f : F)\n (o : orbitRel.Quotient (\u0393 : Subgroup (GL (Fin 2) \u211d)) \u210d) : \u211a :=\n 2 * (orderOfVanishingOnSubgroupOrbit f o : \u211a) / (cardStabilizerOnOrbit o : \u211a)\n\n/-- The defining equation of `weightedOrderOfVanishingOnSubgroupOrbit`. -/\nlemma weightedOrderOfVanishingOnSubgroupOrbit_def\n [SlashInvariantFormClass F (\u0393 : Subgroup (GL (Fin 2) \u211d)) k] (f : F)\n (o : orbitRel.Quotient (\u0393 : Subgroup (GL (Fin 2) \u211d)) \u210d) :\n weightedOrderOfVanishingOnSubgroupOrbit f o =\n 2 * (orderOfVanishingOnSubgroupOrbit f o : \u211a) / (cardStabilizerOnOrbit o : \u211a) :=\n (rfl)\n\n/-- Evaluating the weighted order on the orbit of `p` recovers twice the pointwise order divided\nby the order of its stabiliser in `\u0393`. -/\n@[simp]\nlemma weightedOrderOfVanishingOnSubgroupOrbit_mk\n [SlashInvariantFormClass F (\u0393 : Subgroup (GL (Fin 2) \u211d)) k] (f : F) (p : \u210d) :\n weightedOrderOfVanishingOnSubgroupOrbit f (Quotient.mk'' p) =\n 2 * (orderOfVanishingAt \u21d1f p : \u211a) /\n (Nat.card (stabilizer (\u0393 : Subgroup (GL (Fin 2) \u211d)) p) : \u211a) := by\n rw [weightedOrderOfVanishingOnSubgroupOrbit_def, orderOfVanishingOnSubgroupOrbit_mk,\n cardStabilizerOnOrbit_mk]\n\n/-- Multiplying the weighted order by the stabiliser order recovers twice the plain vanishing\norder. -/\nlemma cardStabilizerOnOrbit_mul_weightedOrderOfVanishingOnSubgroupOrbit\n [SlashInvariantFormClass F (\u0393 : Subgroup (GL (Fin 2) \u211d)) k] (f : F)\n (o : orbitRel.Quotient (\u0393 : Subgroup (GL (Fin 2) \u211d)) \u210d) :\n (cardStabilizerOnOrbit o : \u211a) * weightedOrderOfVanishingOnSubgroupOrbit f o =\n 2 * (orderOfVanishingOnSubgroupOrbit f o : \u211a) := by\n rw [weightedOrderOfVanishingOnSubgroupOrbit_def]\n exact mul_div_cancel\u2080 _ (by exact_mod_cast cardStabilizerOnOrbit_ne_zero o)\n\n/-- **The level-one weight is the same weight.** `ord_P f / e_P` is `2 \u00b7 ord_P f` divided by the\norder of the matrix stabiliser, because `-I` lies in `SL(2, \u2124)` and fixes every point. This is\nwhat makes `weightedOrderOfVanishingOnSubgroupOrbit` the general-level form of\n`weightedOrderOfVanishingOnOrbit` rather than a second convention. -/\nlemma weightedOrderOfVanishingOnOrbit_eq_two_mul_div [SlashInvariantFormClass F \ud835\udcae\u2112 k] (f : F)\n (q : orbitRel.Quotient SL(2, \u2124) \u210d) :\n weightedOrderOfVanishingOnOrbit f q =\n 2 * (orderOfVanishingOnOrbit f q : \u211a) / (cardStabilizerOnOrbit q : \u211a) := by\n have he : (ModularGroup.ellipticOrder q : \u211a) \u2260 0 := by\n exact_mod_cast (ModularGroup.ellipticOrder_pos q).ne'\n rw [weightedOrderOfVanishingOnOrbit_def,\n ModularGroup.cardStabilizerOnOrbit_eq_two_mul_ellipticOrder]\n push_cast\n field_simp\n\n/-- **One `\u0393`-orbit's share of the level-one weight.** The summand of the level-one weighted\norder at the `SL(2, \u2124)`-orbit of `p` \u2014 the number of cosets translating `p` into the `\u0393`-orbit\n`o`, times the order there, scaled by the level-one elliptic order \u2014 is the general-level\nweighted order at `o`, and vanishes off the fibre. -/\nprivate lemma card_fiber_smul_orderOfVanishingOnSubgroupOrbit_mul_ellipticOrder_inv_eq_indicator\n [SlashInvariantFormClass F (\u0393 : Subgroup (GL (Fin 2) \u211d)) k] (f : F) (p : \u210d)\n (o : orbitRel.Quotient (\u0393 : Subgroup (GL (Fin 2) \u211d)) \u210d) :\n ((Nat.card {q : \ud835\udcae\u2112 \u29f8 (\u0393 : Subgroup (GL (Fin 2) \u211d)).subgroupOf \ud835\udcae\u2112 //\n orbitOfCosetTranslate p q = o} \u2022 orderOfVanishingOnSubgroupOrbit f o : \u2124) : \u211a) *\n (ModularGroup.ellipticOrder (Quotient.mk'' p : orbitRel.Quotient SL(2, \u2124) \u210d) : \u211a)\u207b\u00b9 =\n Set.indicator (slOrbitOfSubgroupOrbit (\u0393 := \u0393) \u207b\u00b9'\n {(Quotient.mk'' p : orbitRel.Quotient SL(2, \u2124) \u210d)})\n (weightedOrderOfVanishingOnSubgroupOrbit f) o := by\n have he : (ModularGroup.ellipticOrder\n (Quotient.mk'' p : orbitRel.Quotient SL(2, \u2124) \u210d) : \u211a) \u2260 0 := by\n exact_mod_cast (ModularGroup.ellipticOrder_pos _).ne'\n by_cases ho : slOrbitOfSubgroupOrbit o = (Quotient.mk'' p : orbitRel.Quotient SL(2, \u2124) \u210d)\n \u00b7 rw [Set.indicator_of_mem (by simpa using ho), weightedOrderOfVanishingOnSubgroupOrbit_def]\n have hprod := card_fiber_orbitOfCosetTranslate_mul_cardStabilizerOnOrbit_eq p ho\n have hc : (cardStabilizerOnOrbit o : \u211a) \u2260 0 := by\n exact_mod_cast cardStabilizerOnOrbit_ne_zero o\n have hprod' : (Nat.card {q : \ud835\udcae\u2112 \u29f8 (\u0393 : Subgroup (GL (Fin 2) \u211d)).subgroupOf \ud835\udcae\u2112 //\n orbitOfCosetTranslate p q = o} : \u211a) * (cardStabilizerOnOrbit o : \u211a) =\n 2 * (ModularGroup.ellipticOrder\n (Quotient.mk'' p : orbitRel.Quotient SL(2, \u2124) \u210d) : \u211a) := by\n exact_mod_cast congrArg (fun n : \u2115 \u21a6 (n : \u211a)) hprod\n rw [nsmul_eq_mul]\n push_cast\n field_simp\n linear_combination (orderOfVanishingOnSubgroupOrbit f o : \u211a) * hprod'\n \u00b7 rw [Set.indicator_of_notMem (by simpa using ho),\n card_fiber_orbitOfCosetTranslate_eq_zero p ho]\n simp\n\n/-- **The level-one weight at a point redistributes over the `\u0393`-orbits above it.** The weighted\nvanishing order of the norm at the `SL(2, \u2124)`-orbit of `p` is the sum of the general-level\nweighted orders of `f` over the `\u0393`-orbits inside that orbit.\n\nThis is the local form of the general-level valence formula: each coset of `\u0393` in `SL(2, \u2124)`\ncontributes one factor to the norm, the cosets landing in one `\u0393`-orbit are counted by the\norbit-stabiliser identity, and the stabiliser weight is exactly what converts that count into\nthe weight `2 / |Stab_\u0393 P|`. -/\nlemma weightedOrderOfVanishingOnOrbit_norm_eq_finsum_mem\n [(\u0393 : Subgroup (GL (Fin 2) \u211d)).IsFiniteRelIndex \ud835\udcae\u2112]\n [ModularFormClass F (\u0393 : Subgroup (GL (Fin 2) \u211d)) k] (f : F) (hf : (\u21d1f : \u210d \u2192 \u2102) \u2260 0)\n (P : orbitRel.Quotient SL(2, \u2124) \u210d) :\n weightedOrderOfVanishingOnOrbit (_root_.ModularForm.norm \ud835\udcae\u2112 f) P =\n \u2211\u1da0 o \u2208 slOrbitOfSubgroupOrbit (\u0393 := \u0393) \u207b\u00b9' {P},\n weightedOrderOfVanishingOnSubgroupOrbit f o := by\n induction P using Quotient.inductionOn' with\n | h p =>\n have hcast : ((\u2211\u1da0 o : orbitRel.Quotient (\u0393 : Subgroup (GL (Fin 2) \u211d)) \u210d,\n Nat.card {q : \ud835\udcae\u2112 \u29f8 (\u0393 : Subgroup (GL (Fin 2) \u211d)).subgroupOf \ud835\udcae\u2112 //\n orbitOfCosetTranslate p q = o} \u2022 orderOfVanishingOnSubgroupOrbit f o : \u2124) : \u211a) =\n \u2211\u1da0 o : orbitRel.Quotient (\u0393 : Subgroup (GL (Fin 2) \u211d)) \u210d,\n ((Nat.card {q : \ud835\udcae\u2112 \u29f8 (\u0393 : Subgroup (GL (Fin 2) \u211d)).subgroupOf \ud835\udcae\u2112 //\n orbitOfCosetTranslate p q = o} \u2022 orderOfVanishingOnSubgroupOrbit f o : \u2124) : \u211a) :=\n AddMonoidHom.map_finsum_of_injective (Int.castAddHom \u211a) Int.cast_injective _\n rw [weightedOrderOfVanishingOnOrbit_mk, orderOfVanishingAt_norm_eq_finsum_orbit f hf p,\n finsum_mem_def, div_eq_mul_inv, hcast, finsum_mul]\n exact finsum_congr\n (card_fiber_smul_orderOfVanishingOnSubgroupOrbit_mul_ellipticOrder_inv_eq_indicator f p)\n\n/-- The general-level weighted order is nonnegative: a modular form is holomorphic and the\nweight is positive. -/\nlemma weightedOrderOfVanishingOnSubgroupOrbit_nonneg\n [ModularFormClass F (\u0393 : Subgroup (GL (Fin 2) \u211d)) k] (f : F)\n (o : orbitRel.Quotient (\u0393 : Subgroup (GL (Fin 2) \u211d)) \u210d) :\n 0 \u2264 weightedOrderOfVanishingOnSubgroupOrbit f o := by\n rw [weightedOrderOfVanishingOnSubgroupOrbit_def]\n refine div_nonneg ?_ (by positivity)\n have := orderOfVanishingOnSubgroupOrbit_nonneg f o\n positivity\n\n/-- Only finitely many `\u0393`-orbits carry nonzero weighted order: the weight cannot create support\nwhere the order has none. -/\nlemma hasFiniteSupport_weightedOrderOfVanishingOnSubgroupOrbit [\u0393.FiniteIndex]\n [ModularFormClass F (\u0393 : Subgroup (GL (Fin 2) \u211d)) k] (f : F) :\n Function.HasFiniteSupport (weightedOrderOfVanishingOnSubgroupOrbit (\u0393 := \u0393) (k := k) f) := by\n refine (hasFiniteSupport_orderOfVanishingOnSubgroupOrbit f).subset fun o ho \u21a6 ?_\n simp only [Function.mem_support, ne_eq] at ho \u22a2\n exact fun h0 \u21a6 ho (by rw [weightedOrderOfVanishingOnSubgroupOrbit_def, h0]; simp)\n\n", "statement": "/-- **The interior mass of the norm, redistributed over the `\u0393`-orbits.** The level-one weighted\ndivisor sum of `ModularForm.norm \ud835\udcae\u2112 f` is the general-level weighted divisor sum of `f`.\n\nEach `SL(2, \u2124)`-orbit splits into finitely many `\u0393`-orbits, and\n`weightedOrderOfVanishingOnOrbit_norm_eq_finsum_mem` evaluates the level-one weight at that orbit\nas the sum of the general-level weights over the pieces. -/\ntheorem finsum_weightedOrderOfVanishingOnSubgroupOrbit_eq_finsum_norm [\u0393.FiniteIndex]\n [ModularFormClass F (\u0393 : Subgroup (GL (Fin 2) \u211d)) k] (f : F) (hf : (\u21d1f : \u210d \u2192 \u2102) \u2260 0) :\n (\u2211\u1da0 o : orbitRel.Quotient (\u0393 : Subgroup (GL (Fin 2) \u211d)) \u210d,\n weightedOrderOfVanishingOnSubgroupOrbit f o) =\n \u2211\u1da0 P : orbitRel.Quotient SL(2, \u2124) \u210d,\n weightedOrderOfVanishingOnOrbit (_root_.ModularForm.norm \ud835\udcae\u2112 f) P ", "proof": " by\n have hsupp : (Function.support\n (weightedOrderOfVanishingOnSubgroupOrbit (\u0393 := \u0393) (k := k) f)).Finite :=\n hasFiniteSupport_weightedOrderOfVanishingOnSubgroupOrbit f\n set I := slOrbitOfSubgroupOrbit (\u0393 := \u0393) ''\n Function.support (weightedOrderOfVanishingOnSubgroupOrbit (\u0393 := \u0393) (k := k) f) with hIdef\n -- the orbits carrying mass are covered by the fibres above their own image\n have hrestrict : (\u2211\u1da0 o : orbitRel.Quotient (\u0393 : Subgroup (GL (Fin 2) \u211d)) \u210d,\n weightedOrderOfVanishingOnSubgroupOrbit f o) =\n \u2211\u1da0 o \u2208 \u22c3 P \u2208 I, slOrbitOfSubgroupOrbit (\u0393 := \u0393) \u207b\u00b9' {P},\n weightedOrderOfVanishingOnSubgroupOrbit f o := by\n rw [finsum_mem_def, hIdef, Set.biUnion_preimage_singleton,\n Set.indicator_eq_self.mpr (Set.subset_preimage_image _ _)]\n rw [hrestrict,\n finsum_mem_biUnion (Set.pairwiseDisjoint_fiber (slOrbitOfSubgroupOrbit (\u0393 := \u0393)) I)\n (hsupp.image _)\n fun P _ \u21a6 finite_preimage_slOrbitOfSubgroupOrbit P,\n finsum_mem_congr rfl fun P _ \u21a6\n (weightedOrderOfVanishingOnOrbit_norm_eq_finsum_mem f hf P).symm, finsum_mem_def]\n -- and every `SL(2, \u2124)`-orbit carrying mass in the norm is one of them\n refine congrArg finsum (Set.indicator_eq_self.mpr fun P hP \u21a6 ?_)\n rw [Function.mem_support, weightedOrderOfVanishingOnOrbit_norm_eq_finsum_mem f hf P] at hP\n by_contra hPI\n refine hP (finsum_mem_of_eqOn_zero fun o ho \u21a6 ?_)\n by_contra hne\n exact hPI \u27e8o, hne, by simpa using ho\u27e9", "proof_lines": 25, "proof_length": 1199, "rev": "75c8aed5fea63047615a25a9763fd5b68a86e891", "heartbeats": 673, "image": "lean-compression:tauceti-75c8aed5fe-a608030cfc", "split": "dev"} {"path": "TauCeti/AlgebraicGeometry/Curves/NodalGluing/RingedLift.lean", "module": "TauCeti.AlgebraicGeometry.Curves.NodalGluing.RingedLift", "theorem": "TauCeti.NodalGluing.Iso.sheafedSpaceHom_ofSheafedSpaceIso", "prefix": "/-\nCopyright (c) 2026 The Tau Ceti contributors. All rights reserved.\nReleased under Apache 2.0 license as described in the file LICENSE.\nAuthors: The Tau Ceti contributors\n-/\nmodule\n\npublic import TauCeti.AlgebraicGeometry.Curves.NodalGluing.HolomorphicLift\npublic import TauCeti.AlgebraicGeometry.Curves.NodalGluing.IntrinsicNodes\nimport Mathlib.LinearAlgebra.Complex.FiniteDimensional\nimport TauCeti.Geometry.Manifold.Connected\nimport TauCeti.Geometry.RingedSpace.PresheafedSpace.Basic\n\n/-!\n# Lifting ringed isomorphisms of nodal curves\n\nAn analytic isomorphism of normalizations respecting the flag pairs descends to an isomorphism\nof the holomorphic sheafed spaces of the glued curves (`Iso.sheafedSpaceIso`). This file proves\nthe converse: an isomorphism of these sheafed spaces whose section maps fix the constants comes\nfrom a unique analytic nodal isomorphism. Descent and lifting are mutually inverse, so actual\nnodal isomorphisms are exactly the `\u2102`-linear isomorphisms of the ringed glued curves.\nThe section maps of such an isomorphism are evaluation at image points\n(`quotientSheafSectionsEquiv_app_apply`, in the ringed descent file).\n\n* `Iso.ofSheafedSpaceIso` constructs the nodal isomorphism. Nodes are preserved because they are\n recognized by their stalks (`mem_nodeSet_iff_of_isIso_stalkMap`), so the underlying\n homeomorphism lifts to the normalizations (`liftHomeomorph`). A chart coordinate at an image\n point off the flags is a section downstairs, and its pullback is the chart written after the\n lift, so the lift is holomorphic off the flags; `Iso.ofHolomorphicLift` removes the flag\n singularities.\n* `Iso.sheafedSpaceIso_ofSheafedSpaceIso` and `Iso.ofSheafedSpaceIso_sheafedSpaceIso`: descent\n and lifting are mutually inverse, including on the maps of sections.\n* `existsUnique_iso_sheafedSpaceIso_eq_iff`: an isomorphism of the sheafed spaces is induced by a\n unique nodal isomorphism exactly when its section maps fix the constants.\n\nThe constants hypothesis cannot be dropped. The sheaves are sheaves of commutative rings, and\ncomposing with complex conjugation turns an antiholomorphic identification of two curves into an\nisomorphism of their sheafed spaces which fixes only the real constants.\n\nNo compactness, connectedness or finiteness of the set of components is assumed. Self-nodes and\ninterchanges of the two branches of a node are allowed.\n\n## References\n\n* Hans Grauert and Reinhold Remmert, *Coherent Analytic Sheaves* (Grundlehren der\n mathematischen Wissenschaften 265, Springer, 1984), Chapter 1, \u00a71, for `\u2102`-ringed spaces and\n the values of pulled-back sections.\n* Joel W. Robbin and Dietmar A. Salamon, *A construction of the Deligne\u2013Mumford orbifold*,\n J. Eur. Math. Soc. 8 (2006), 611\u2013699, for normalization and actual nodal isomorphisms.\n-/\n\npublic noncomputable section\n\nopen CategoryTheory Opposite TopologicalSpace AlgebraicGeometry Set Topology\nopen scoped Manifold ContDiff\n\nnamespace TauCeti.NodalGluing\n\nopen holomorphicStructureSheaf\n\nvariable {\u03b9 Flag : Type} {X : \u03b9 \u2192 Type} [\u2200 i, TopologicalSpace (X i)]\n [\u2200 i, ChartedSpace \u2102 (X i)] [\u2200 i, IsManifold \ud835\udcd8(\u2102) 1 (X i)]\n [\u2200 i, T2Space (X i)] [Finite Flag] {d : FlagPairData \u03b9 Flag X}\n {\u03b9' Flag' : Type} {X' : \u03b9' \u2192 Type} [\u2200 i, TopologicalSpace (X' i)]\n [\u2200 i, ChartedSpace \u2102 (X' i)] [\u2200 i, IsManifold \ud835\udcd8(\u2102) 1 (X' i)]\n [\u2200 i, T2Space (X' i)] [Finite Flag'] {d' : FlagPairData \u03b9' Flag' X'}\n\n/-- The homeomorphism of glued curves underlying an isomorphism of nodal sheafed spaces. -/\nprivate def baseHomeomorph (\u03c6 : sheafedSpace \ud835\udcd8(\u2102) d \u2245 sheafedSpace \ud835\udcd8(\u2102) d') :\n GluedCurve d \u2243\u209c GluedCurve d' :=\n TopCat.homeoOfIso ((SheafedSpace.forget CommRingCat).mapIso \u03c6)\n\nomit [\u2200 i, IsManifold \ud835\udcd8(\u2102) 1 (X i)] [\u2200 i, T2Space (X i)] [Finite Flag]\n [\u2200 i, IsManifold \ud835\udcd8(\u2102) 1 (X' i)] [\u2200 i, T2Space (X' i)] [Finite Flag'] in\nprivate theorem baseHomeomorph_apply (\u03c6 : sheafedSpace \ud835\udcd8(\u2102) d \u2245 sheafedSpace \ud835\udcd8(\u2102) d')\n (z : GluedCurve d) : baseHomeomorph \u03c6 z = \u03c6.hom.hom.base z := (rfl)\n\n/-- An isomorphism of nodal sheafed spaces maps nodes exactly to nodes. -/\nprivate theorem baseHomeomorph_mem_nodeSet_iff (\u03c6 : sheafedSpace \ud835\udcd8(\u2102) d \u2245 sheafedSpace \ud835\udcd8(\u2102) d')\n (z : GluedCurve d) : baseHomeomorph \u03c6 z \u2208 nodeSet d' \u2194 z \u2208 nodeSet d :=\n mem_nodeSet_iff_of_isIso_stalkMap d \u03c6.hom z\n\nomit [\u2200 i, IsManifold \ud835\udcd8(\u2102) 1 (X i)] [\u2200 i, T2Space (X i)] in\n/-- Flag points of a complex curve have small neighbourhoods with connected punctures. -/\nprivate theorem exists_mem_nhds_isConnected (x : \u03a3 i, X i) (U : Set (\u03a3 i, X i)) (hU : U \u2208 \ud835\udcdd x) :\n \u2203 V \u2208 \ud835\udcdd x, V \u2286 U \u2227 IsConnected (V \\ {x}) :=\n exists_mem_nhds_subset_isConnected_sdiff_singleton (E := \u2102)\n (by rw [Complex.rank_real_complex]; exact Cardinal.one_lt_two) x hU\n\n/-- Near a point off the flags, the chart coordinate is a section of the nodal structure sheaf:\nthe chart source minus the flags is an open set on which the quotient map is injective. -/\nprivate theorem exists_chartAt_section {y : \u03a3 i, X i} (hy : y \u2209 flagPointSet d) :\n \u2203 (U : Opens (GluedCurve d)) (g : (sheafedSpace \ud835\udcd8(\u2102) d).presheaf.obj (op U)),\n Quotient.mk _ y \u2208 U \u2227 \u2200 (p : \u03a3 i, X i) (hp : Quotient.mk (gluedRelSetoid d) p \u2208 U),\n (quotientSheafSectionsEquiv \ud835\udcd8(\u2102) _ U g).val \u27e8p, hp\u27e9 = chartAt \u2102 y p := by\n set S : Set (\u03a3 i, X i) := (chartAt \u2102 y).source \u2229 (flagPointSet d)\u1d9c\n have hSopen : IsOpen S :=\n (chartAt \u2102 y).open_source.inter (flagPointSet_finite d).isClosed.isOpen_compl\n -- No point of `S` is identified with another point, so `S` is saturated.\n have hsat : Quotient.mk (gluedRelSetoid d) \u207b\u00b9' (Quotient.mk _ '' S) = S := by\n refine Set.Subset.antisymm ?_ (Set.subset_preimage_image _ _)\n rintro p \u27e8q, hq, hqp\u27e9\n rwa [\u2190 eq_of_mk_eq_of_notMem_flagPointSet hq.2 hqp]\n rw [\u2190 hsat] at hSopen\n let U : Opens (GluedCurve d) :=\n \u27e8Quotient.mk _ '' S, isQuotientMap_quotient_mk'.isOpen_preimage.mp hSopen\u27e9\n have hmemU (p : \u03a3 i, X i) : Quotient.mk _ p \u2208 U \u2194 p \u2208 S := by\n rw [\u2190 SetLike.mem_coe, Opens.coe_mk, \u2190 Set.mem_preimage, hsat]\n let \u03c7 : (holomorphicStructureSheaf \ud835\udcd8(\u2102) (\u03a3 i, X i)).obj.obj\n (op ((Opens.map (TopCat.quotientMk (gluedRelSetoid d))).obj U)) :=\n ofMDifferentiable (fun p \u21a6 chartAt \u2102 y p.val) fun p \u21a6\n ((mdifferentiableAt_of_mem_maximalAtlas (IsManifold.chart_mem_maximalAtlas y)\n ((hmemU p.val).mp p.property).1).comp p\n (contMDiff_subtypeVal (n := 1).mdifferentiable one_ne_zero p))\n have h\u03c7 : \u03c7 \u2208 quotientSectionSubring \ud835\udcd8(\u2102) (gluedRelSetoid d) U := by\n rw [quotientSectionSubring_eq_top_of_injOn]\n \u00b7 trivial\n \u00b7 intro p hp q _ hpq\n exact eq_of_mk_eq_of_notMem_flagPointSet ((hmemU p).mp hp).2 hpq\n refine \u27e8U, (quotientSheafSectionsEquiv \ud835\udcd8(\u2102) _ U).symm \u27e8\u03c7, h\u03c7\u27e9,\n (hmemU y).mpr \u27e8mem_chart_source \u2102 y, hy\u27e9, fun p hp \u21a6 ?_\u27e9\n rw [RingEquiv.apply_symm_apply]\n exact ofMDifferentiable_apply (fun p : (Opens.map (TopCat.quotientMk (gluedRelSetoid d))).obj U \u21a6\n chartAt \u2102 y p.val) _ \u27e8p, hp\u27e9\n\n/-- The normalization lift of an isomorphism of nodal sheafed spaces fixing the constants is\nholomorphic away from the flag points: a chart coordinate at the image point is a section of\nthe target sheaf, and its pullback is the chart written after the lift. -/\nprivate theorem mdifferentiableOn_liftHomeomorph (\u03c6 : sheafedSpace \ud835\udcd8(\u2102) d \u2245 sheafedSpace \ud835\udcd8(\u2102) d')\n (h\u03c6 : \u2200 (U : Opens (GluedCurve d')) (c : \u2102),\n (\u03c6.hom.hom.c.app (op U)).hom (algebraMap \u2102 _ c) =\n algebraMap \u2102 ((sheafedSpace \ud835\udcd8(\u2102) d).presheaf.obj\n (op ((Opens.map \u03c6.hom.hom.base).obj U))) c) :\n MDifferentiableOn \ud835\udcd8(\u2102) \ud835\udcd8(\u2102) (liftHomeomorph (baseHomeomorph \u03c6)\n (baseHomeomorph_mem_nodeSet_iff \u03c6) (fun x _ \u21a6 exists_mem_nhds_isConnected x)\n (fun x _ \u21a6 exists_mem_nhds_isConnected x)) (flagPointSet d)\u1d9c := by\n set L := liftHomeomorph (baseHomeomorph \u03c6) (baseHomeomorph_mem_nodeSet_iff \u03c6)\n (fun x _ \u21a6 exists_mem_nhds_isConnected x) (fun x _ \u21a6 exists_mem_nhds_isConnected x)\n have hL (p : \u03a3 i, X i) : Quotient.mk (gluedRelSetoid d') (L p) =\n \u03c6.hom.hom.base (Quotient.mk (gluedRelSetoid d) p) := mk_liftHomeomorph p\n intro x hx\n refine MDifferentiableAt.mdifferentiableWithinAt ?_\n obtain \u27e8U, g, hyU, hg\u27e9 := exists_chartAt_section (d := d')\n ((liftHomeomorph_mem_flagPointSet_iff x).not.mpr hx)\n -- The pullback of the chart coordinate is the chart written after the lift.\n have hxU : x \u2208 (Opens.map (TopCat.quotientMk (gluedRelSetoid d))).obj\n ((Opens.map \u03c6.hom.hom.base).obj U) := by\n rw [Opens.mem_map, Opens.mem_map, TopCat.quotientMk_apply, \u2190 hL]\n exact hyU\n have hdiff : ContMDiffAt \ud835\udcd8(\u2102) \ud835\udcd8(\u2102) \u03c9 (fun p : (Opens.map (TopCat.quotientMk\n (gluedRelSetoid d))).obj ((Opens.map \u03c6.hom.hom.base).obj U) \u21a6 chartAt \u2102 (L x) (L p.val))\n \u27e8x, hxU\u27e9 :=\n (holomorphicStructureSheaf.contMDiff _).contMDiffAt.congr_of_eventuallyEq\n (.of_forall fun p \u21a6 ((quotientSheafSectionsEquiv_app_apply \u03c6.hom h\u03c6 U g p (L p.val)\n (hL p.val)).trans (hg _ _)).symm)\n rw [mdifferentiableAt_iff_target, extChartAt_coe, modelWithCornersSelf_coe]\n exact \u27e8L.continuous.continuousAt,\n ((contMDiffAt_subtype_iff (x := \u27e8x, hxU\u27e9)).mp hdiff).mdifferentiableAt (by simp)\u27e9\n\nnamespace Iso\n\n/-- **Lifting ringed isomorphisms of nodal curves.** An isomorphism of the holomorphic sheafed\nspaces of two nodal curves whose section maps fix the constants is induced by an analytic\nisomorphism of the normalizations respecting the flag pairs\n(`sheafedSpaceIso_ofSheafedSpaceIso`). -/\ndef ofSheafedSpaceIso (\u03c6 : sheafedSpace \ud835\udcd8(\u2102) d \u2245 sheafedSpace \ud835\udcd8(\u2102) d')\n (h\u03c6 : \u2200 (U : Opens (GluedCurve d')) (c : \u2102),\n (\u03c6.hom.hom.c.app (op U)).hom (algebraMap \u2102 _ c) =\n algebraMap \u2102 ((sheafedSpace \ud835\udcd8(\u2102) d).presheaf.obj\n (op ((Opens.map \u03c6.hom.hom.base).obj U))) c) : Iso \ud835\udcd8(\u2102) \u03c9 d d' :=\n ofHolomorphicLift (mdifferentiableOn_liftHomeomorph \u03c6 h\u03c6)\n\nvariable {\u03c6 : sheafedSpace \ud835\udcd8(\u2102) d \u2245 sheafedSpace \ud835\udcd8(\u2102) d'}\n {h\u03c6 : \u2200 (U : Opens (GluedCurve d')) (c : \u2102),\n (\u03c6.hom.hom.c.app (op U)).hom (algebraMap \u2102 _ c) =\n algebraMap \u2102 ((sheafedSpace \ud835\udcd8(\u2102) d).presheaf.obj\n (op ((Opens.map \u03c6.hom.hom.base).obj U))) c}\n\n/-- The lifted isomorphism covers the map of glued curves underlying `\u03c6`. -/\n@[simp]\ntheorem mk_ofSheafedSpaceIso (x : \u03a3 i, X i) :\n Quotient.mk (gluedRelSetoid d') (ofSheafedSpaceIso \u03c6 h\u03c6 x) =\n \u03c6.hom.hom.base (Quotient.mk (gluedRelSetoid d) x) := by\n rw [ofSheafedSpaceIso, coe_ofHolomorphicLift, mk_liftHomeomorph, baseHomeomorph_apply]\n\n/-- The lifted isomorphism descends to the map of glued curves underlying `\u03c6`. -/\n@[simp]\ntheorem gluedCurveHomeomorph_ofSheafedSpaceIso (z : GluedCurve d) :\n (ofSheafedSpaceIso \u03c6 h\u03c6).gluedCurveHomeomorph z = \u03c6.hom.hom.base z := by\n rw [ofSheafedSpaceIso, gluedCurveHomeomorph_ofHolomorphicLift, baseHomeomorph_apply]\n\n", "statement": "/-- **Descent undoes lifting.** The lifted isomorphism induces the forward map of `\u03c6`,\nincluding its maps on holomorphic sections. -/\n@[simp]\ntheorem sheafedSpaceHom_ofSheafedSpaceIso :\n (ofSheafedSpaceIso \u03c6 h\u03c6).sheafedSpaceHom = \u03c6.hom ", "proof": " by\n apply InducedCategory.hom_ext\n refine PresheafedSpace.ext_of_app (TopCat.ext fun z \u21a6 ?_) fun U \u21a6 ?_\n \u00b7 rw [sheafedSpaceHom_hom_base_apply]\n exact gluedCurveHomeomorph_ofSheafedSpaceIso (\u03c6 := \u03c6) (h\u03c6 := h\u03c6) z\n \u00b7 apply sheafedSpace_sectionMap_ext\n intro g x\n refine ((sheafedSpace_map_apply \ud835\udcd8(\u2102) d _ _ x).trans\n (pullbackSection_apply _ U g _)).trans ?_\n rw [quotientSheafSectionsEquiv_app_apply \u03c6.hom h\u03c6 U g x _\n (mk_ofSheafedSpaceIso (\u03c6 := \u03c6) (h\u03c6 := h\u03c6) x.val)]", "proof_lines": 10, "proof_length": 454, "rev": "75c8aed5fea63047615a25a9763fd5b68a86e891", "heartbeats": 2995, "image": "lean-compression:tauceti-75c8aed5fe-a608030cfc", "split": "dev"} {"path": "TauCeti/NumberTheory/LFunctions/Zeros/OneSidedBound/AuxiliaryPrimes.lean", "module": "TauCeti.NumberTheory.LFunctions.Zeros.OneSidedBound.AuxiliaryPrimes", "theorem": "TauCeti.OneSidedBound.eventually_log_window_bounds", "prefix": "/-\nCopyright (c) 2026 The Tau Ceti contributors. All rights reserved.\nReleased under Apache 2.0 license as described in the file LICENSE.\nAuthors: The Tau Ceti contributors\n-/\nmodule\n\npublic import Mathlib.Basic.Real.Basic\npublic import Mathlib.Order.Filter.AtTopBot.Basic\nimport Mathlib.Tactic.Linarith\n\n/-!\n# Logarithmic window bounds for the principal level\n\nTo choose more split primes than the class number of the quadratic field, use disjoint\nwindows of width `W` in `[10 log b, 11 log b]`, where `W^6 \u2264 log b \u2264 W^6 + 1`.\nThis file proves that the windows fit and that their left endpoints lie in `[W, W^7]`.\nIt does not assert that the windows contain primes.\n\nThe interval and the scale are from `New.Parameters.IsLargeScale.exists_isAdmissibleData`\nin `New/Reduction/Data/Existence.lean` of lsernau/grh-lean at\n`72fead102f663d5c7a407964a13dc0cf9d977207`.\n-/\n\npublic section\n\nopen Filter\n\nnamespace TauCeti.OneSidedBound\n\n", "statement": "/-- For large `W` and `W^6 \u2264 L \u2264 W^6 + 1`, the interval `[10 * L, 11 * L]` lies in\n`[W, W^7]` and can hold `n` windows of width `W` with left endpoints spaced by `2 * W`.\nFor the principal level take `L = log b` and `n` one more than the class number. -/\ntheorem eventually_log_window_bounds (n : \u2115) :\n \u2200\u1da0 W : \u211d in atTop, \u2200 L : \u211d, W ^ 6 \u2264 L \u2192 L \u2264 W ^ 6 + 1 \u2192\n 1 \u2264 W \u2227 W \u2264 10 * L \u2227 10 * L + 2 * n * W \u2264 11 * L \u2227 11 * L \u2264 W ^ 7 ", "proof": " by\n filter_upwards [eventually_ge_atTop (max 22 (2 * n : \u211d))] with W hW L hlo hhi\n have h22 := (le_max_left _ _).trans hW\n have hn := (le_max_right _ _).trans hW\n have h1 : 1 \u2264 W := by linarith\n have hW0 : 0 \u2264 W := zero_le_one.trans h1\n have hW6 : W \u2264 W ^ 6 := by simpa using pow_le_pow_right\u2080 h1 (by decide : 1 \u2264 6)\n refine \u27e8h1, by linarith, ?_, ?_\u27e9\n \u00b7 have hW2 : W ^ 2 \u2264 W ^ 6 := pow_le_pow_right\u2080 h1 (by decide)\n nlinarith [mul_le_mul_of_nonneg_right hn hW0]\n \u00b7 calc\n 11 * L \u2264 22 * W ^ 6 := by linarith\n _ \u2264 W ^ 7 := by simpa [pow_succ, mul_comm] using\n mul_le_mul_of_nonneg_right h22 (pow_nonneg hW0 6)", "proof_lines": 13, "proof_length": 593, "rev": "75c8aed5fea63047615a25a9763fd5b68a86e891", "heartbeats": 3293, "image": "lean-compression:tauceti-75c8aed5fe-a608030cfc", "split": "dev"} {"path": "TauCeti/Analysis/SpecialFunctions/Polylogarithm/Basic.lean", "module": "TauCeti.Analysis.SpecialFunctions.Polylogarithm.Basic", "theorem": "TauCeti.Polylog.analyticAt_polylog_neg_nat", "prefix": "/-\nCopyright (c) 2026 Tau Ceti. All rights reserved.\nReleased under Apache 2.0 license as described in the file LICENSE.\nAuthors: Tau Ceti\n-/\nmodule\n\npublic import Mathlib.Analysis.SpecialFunctions.Complex.LogBounds\npublic import Mathlib.Analysis.Calculus.FDeriv.Analytic\npublic import Mathlib.MeasureTheory.Integral.IntervalIntegral.Basic\nimport Mathlib.Analysis.Calculus.Deriv.CompMul\nimport Mathlib.Analysis.Calculus.Deriv.ZPow\n\n/-!\n# Principal polylogarithms of integer weight\n\n`TauCeti.Polylog.polylog` is the principal integer-weight polylogarithm. Weight zero is\n`z / (1 - z)`, weight one is `-Complex.log (1 - z)`, and higher weights are defined by\nlogarithmic radial integrals. Negative weights are iterated Euler derivatives of weight zero.\nThe logarithm in the integral uses Mathlib's principal argument, so values on the real cut\nselect the lower boundary convention.\n\nThis file gives the defining identities, vanishing at zero, the nonpositive-weight Euler\nrecursion, the action of the Euler differential operator `z \u21a6 z * deriv \u00b7 z` on nonpositive\nweights composed with monomials `w \u21a6 c * w ^ k` and on finite sums of linear rescalings\n`w \u21a6 c * w`, and analyticity of nonpositive weights away from their pole. The explicit\nweight-minus-one formula and the value of weight one at 3 check the Euler operator and logarithm\nconventions. No regularity at a pole is asserted for the totalised values.\n\n## References\n\n* Joseph Oesterl\u00e9, *Polylogarithmes*, S\u00e9minaire Bourbaki, expos\u00e9 762,\n Ast\u00e9risque 216 (1993), \u00a71.1, (1)\u2013(3), pp. 50\u201351.\n* Don Zagier, *The dilogarithm function*, in Frontiers in Number Theory, Physics,\n and Geometry II (2007), Part I, introduction, p. 5.\n-/\n\npublic section\n\nnamespace TauCeti.Polylog\n\n/-- The principal polylogarithm in integer weight. For weights at least two, the\nlogarithmic radial integral collapses the iterated radial integrals. Nonpositive\nweights are Euler derivatives of the rational function `z / (1 - z)`.\nValues at poles are totalised and carry no regularity assertion. -/\nnoncomputable def polylog : \u2124 \u2192 \u2102 \u2192 \u2102\n | .ofNat 0, z => z / (1 - z)\n | .ofNat 1, z => -Complex.log (1 - z)\n | .ofNat (k + 2), z =>\n (Nat.factorial k : \u2102)\u207b\u00b9 * \u222b t : \u211d in 0..1,\n ((-Real.log t : \u211d) : \u2102) ^ k * (-Complex.log (1 - (t : \u2102) * z)) / (t : \u2102)\n | .negSucc r, z =>\n ((fun (f : \u2102 \u2192 \u2102) (w : \u2102) => w * deriv f w)^[r + 1])\n (fun w => w / (1 - w)) z\n\n/-- The weight-zero normalization, including its totalised value at 1. -/\n@[simp] theorem polylog_zero_weight (z : \u2102) : polylog 0 z = z / (1 - z) := by\n rfl\n\n/-- Weight one uses Mathlib's principal logarithm. -/\n@[simp] theorem polylog_one (z : \u2102) : polylog 1 z = -Complex.log (1 - z) := by\n rfl\n\n/-- The defining logarithmic radial integral in positive weight at least two. -/\ntheorem polylog_nat_add_two (k : \u2115) (z : \u2102) :\n polylog (k + 2 : \u2115) z =\n (Nat.factorial k : \u2102)\u207b\u00b9 * \u222b t : \u211d in 0..1,\n ((-Real.log t : \u211d) : \u2102) ^ k * (-Complex.log (1 - (t : \u2102) * z)) / (t : \u2102) := by\n rfl\n\n/-- Nonpositive weights are iterated Euler derivatives of weight zero. -/\ntheorem polylog_neg_nat (r : \u2115) :\n polylog (-(r : \u2124)) =\n ((fun (f : \u2102 \u2192 \u2102) (w : \u2102) => w * deriv f w)^[r])\n (fun w => w / (1 - w)) := by\n cases r with\n | zero => rfl\n | succ r => rfl\n\n/-- The Euler recursion for nonpositive weights. It holds even at the totalised\npole because these weights are defined using the total derivative. -/\ntheorem polylog_neg_nat_succ (r : \u2115) (z : \u2102) :\n polylog (-((r + 1 : \u2115) : \u2124)) z = z * deriv (polylog (-(r : \u2124))) z := by\n rw [polylog_neg_nat, Function.iterate_succ_apply', \u2190 polylog_neg_nat]\n\n/-- Every integer-weight polylogarithm vanishes at zero. -/\n@[simp] theorem polylog_zero (n : \u2124) : polylog n 0 = 0 := by\n cases n with\n | ofNat n =>\n rcases n with _ | _ | k\n \u00b7 simp\n \u00b7 simp\n \u00b7 simp [polylog]\n | negSucc r =>\n simp [polylog, Function.iterate_succ_apply']\n\n", "statement": "/-- Nonpositive weights are analytic away from 1, including across the\nprincipal cut of the positive-weight functions. -/\ntheorem analyticAt_polylog_neg_nat (r : \u2115) {z : \u2102} (hz : z \u2260 1) :\n AnalyticAt \u2102 (polylog (-(r : \u2124))) z ", "proof": " by\n induction r with\n | zero =>\n simp only [Nat.cast_zero, neg_zero]\n have hzero : polylog 0 = (fun w : \u2102 => w / (1 - w)) :=\n funext polylog_zero_weight\n rw [hzero]\n have hid : AnalyticAt \u2102 (fun w : \u2102 => w) z := analyticAt_id\n have hconst : AnalyticAt \u2102 (fun _ : \u2102 => (1 : \u2102)) z := analyticAt_const\n exact hid.div (hconst.sub hid) (sub_ne_zero.mpr hz.symm)\n | succ r ih =>\n have h : polylog (-((r + 1 : \u2115) : \u2124)) =\n fun w => w * deriv (polylog (-(r : \u2124))) w :=\n funext (polylog_neg_nat_succ r)\n rw [h]\n exact analyticAt_id.mul ih.deriv", "proof_lines": 15, "proof_length": 519, "rev": "75c8aed5fea63047615a25a9763fd5b68a86e891", "heartbeats": 737, "image": "lean-compression:tauceti-75c8aed5fe-a608030cfc", "split": "dev"} {"path": "TauCeti/RingTheory/Valuation/PrimeSplitting.lean", "module": "TauCeti.RingTheory.Valuation.PrimeSplitting", "theorem": "TauCeti.PreValuationRing.exists_mk_eq_and_algebraMap_eq", "prefix": "/-\nCopyright (c) 2026 The Tau Ceti contributors. All rights reserved.\nReleased under Apache 2.0 license as described in the file LICENSE.\nAuthors: The Tau Ceti contributors\n-/\nmodule\n\npublic import Mathlib.Algebra.Category.Ring.Limits\npublic import Mathlib.CategoryTheory.Limits.Preserves.Finite\npublic import Mathlib.CategoryTheory.Limits.Shapes.Pullback.IsPullback.Basic\npublic import Mathlib.CategoryTheory.Limits.Types.Pullbacks\npublic import Mathlib.RingTheory.LocalRing.ResidueField.Ideal\npublic import TauCeti.RingTheory.Valuation.ValuationRing.Basic\n\n/-!\n# The prime-splitting square of a valuation ring\n\nLet `V` be a valuation domain and `p` a prime ideal of `V`. Then `V \u29f8 p` and the localization\n`V_p` are again valuation domains, the map `p \u2192 p V_p` is an isomorphism of `V`-modules, and the\nsquare of rings\n```\nV \u27f6 V \u29f8 p\n\u2193 \u2193\nV_p \u27f6 \u03ba(p)\n```\nis cartesian. The square glues `V` from the two valuation rings `V \u29f8 p` and `V_p`, whose spectra\nare the two halves of `Spec V` cut at `p`, along their common point `\u03ba(p)`; since `p \u2245 p V_p`, the\nmap `V \u2192 V_p` together with the ideal `p` is a Milnor square. This is the basic step for\ndecomposing a valuation ring along a chain of primes, as in the theory of arc-descent.\n\nThe underlying fact is elementary: if `x \u2208 p` and `s \u2209 p`, then `s` divides `x`, and the quotient\n`x / s` again lies in `p`. Most of this holds for any `PreValuationRing`, with no domain\nhypothesis. That `V \u29f8 p` and `V_p` are valuation domains is the general fact that quotients and\nlocalizations of valuation rings are valuation rings when they are domains, see\n`TauCeti.ValuationRing.of_isLocalization` and the instances next to it.\n\n## Main results\n\n* `TauCeti.PreValuationRing.exists_mem_algebraMap_eq_of_mem_map`: every element of `p S`, for a\n localization `S` at a submonoid avoiding `p`, is the image of an element of `p`.\n* `TauCeti.PreValuationRing.exists_mk_eq_and_algebraMap_eq`: elements of `V \u29f8 p` and `V_p` with\n the same image in `\u03ba(p)` come from a common element of `V`.\n* `TauCeti.ValuationRing.primeEquivMap`: the `V`-linear isomorphism `p \u2243 p V_p`.\n* `TauCeti.ValuationRing.isPullback_quotient_localizationAtPrime`: the square\n `V, V \u29f8 p, V_p, \u03ba(p)` is a pullback square of commutative rings.\n\n## References\n\n* B. Bhatt, A. Mathew, *The arc-topology*, Cambridge J. Math. 9 (2021), Proposition 2.8.\n-/\n\npublic section\n\nopen CategoryTheory\n\nnamespace TauCeti\n\nnamespace PreValuationRing\n\nsection CommSemiring\n\nvariable {R : Type*} [CommSemiring R] [PreValuationRing R]\n\n/-- In a ring with total divisibility, an element `x` of a prime ideal `p` is divisible by every\n`s \u2209 p`, with quotient again in `p`. -/\ntheorem exists_mem_mul_eq_of_mem_of_notMem {p : Ideal R} [p.IsPrime] {x s : R} (hx : x \u2208 p)\n (hs : s \u2209 p) : \u2203 y \u2208 p, s * y = x := by\n obtain \u27e8y, rfl\u27e9 := dvd_of_mem_of_notMem hx hs\n exact \u27e8y, (Ideal.IsPrime.mem_or_mem \u2039_\u203a hx).resolve_left hs, rfl\u27e9\n\n/-- Let `S` be a localization of a ring with total divisibility at a submonoid `M` avoiding a\nprime ideal `p`. Then every element of the extended ideal `p S` is the image of an element\nof `p`. -/\ntheorem exists_mem_algebraMap_eq_of_mem_map {p : Ideal R} [p.IsPrime] {M : Submonoid R}\n (hM : M \u2264 p.primeCompl) {S : Type*} [CommSemiring S] [Algebra R S] [IsLocalization M S]\n {z : S} (hz : z \u2208 p.map (algebraMap R S)) : \u2203 x \u2208 p, algebraMap R S x = z := by\n obtain \u27e8\u27e8\u27e8x, hx\u27e9, s\u27e9, h\u27e9 := (IsLocalization.mem_map_algebraMap_iff M S).mp hz\n obtain \u27e8y, hy, rfl\u27e9 := exists_mem_mul_eq_of_mem_of_notMem hx (hM s.property)\n refine \u27e8y, hy, ?_\u27e9\n rw [map_mul, mul_comm] at h\n exact ((IsLocalization.map_units S s).mul_right_injective h).symm\n\nend CommSemiring\n\nsection CommRing\n\nvariable {R : Type*} [CommRing R] [PreValuationRing R] {p : Ideal R} [p.IsPrime]\n\n", "statement": "/-- In a ring with total divisibility, elements of `R \u29f8 p` and of `R_p` with the same image in\nthe residue field `\u03ba(p)` come from a common element of `R`. -/\ntheorem exists_mk_eq_and_algebraMap_eq {a : R \u29f8 p} {b : Localization.AtPrime p}\n (h : algebraMap (R \u29f8 p) p.ResidueField a = algebraMap _ p.ResidueField b) :\n \u2203 x : R, Ideal.Quotient.mk p x = a \u2227 algebraMap R (Localization.AtPrime p) x = b ", "proof": " by\n obtain \u27e8u, rfl\u27e9 := Ideal.Quotient.mk_surjective a\n -- The two maps `R \u2192 \u03ba(p)`, through `R \u29f8 p` and through `R_p`, agree.\n have hu : algebraMap (R \u29f8 p) p.ResidueField (Ideal.Quotient.mk p u) =\n algebraMap (Localization.AtPrime p) p.ResidueField (algebraMap R _ u) := by\n simp [IsScalarTower.algebraMap_apply R (Localization.AtPrime p) p.ResidueField]\n have hmem : b - algebraMap R _ u \u2208 p.map (algebraMap R (Localization.AtPrime p)) := by\n rw [Localization.AtPrime.map_eq_maximalIdeal, \u2190 IsLocalRing.residue_eq_zero_iff,\n \u2190 IsLocalRing.ResidueField.algebraMap_eq, map_sub, sub_eq_zero, \u2190 h, hu]\n obtain \u27e8y, hy, hyb\u27e9 := exists_mem_algebraMap_eq_of_mem_map le_rfl hmem\n refine \u27e8u + y, ?_, ?_\u27e9\n \u00b7 rw [map_add, Ideal.Quotient.eq_zero_iff_mem.mpr hy, add_zero]\n \u00b7 rw [map_add, hyb, add_sub_cancel]", "proof_lines": 12, "proof_length": 713, "rev": "75c8aed5fea63047615a25a9763fd5b68a86e891", "heartbeats": 3634, "image": "lean-compression:tauceti-75c8aed5fe-a608030cfc", "split": "dev"} {"path": "TauCeti/Probability/Distributions/Logistic/Basic.lean", "module": "TauCeti.Probability.Distributions.Logistic.Basic", "theorem": "TauCeti.Probability.logisticMeasure_eq_withDensity", "prefix": "/-\nCopyright (c) 2026 The Tau Ceti contributors. All rights reserved.\nReleased under Apache 2.0 license as described in the file LICENSE.\nAuthors: Claude\n-/\nmodule\n\npublic import TauCeti.Probability.Density\npublic import TauCeti.Probability.Quantile\npublic import TauCeti.Probability.Distributions.Uniform.Basic\npublic import Mathlib.Analysis.SpecialFunctions.Sigmoid\nimport TauCeti.Analysis.SpecialFunctions.Sigmoid\nimport TauCeti.MeasureTheory.Integral.Exp.Decay\nimport TauCeti.Probability.Distributions.Affine\nimport Mathlib.MeasureTheory.Integral.IntegralEqImproper\n\n/-!\n# The logistic distribution\n\nThe logistic law with location `m` and scale `s > 0` is the law of `m + s * log (U / (1 - U))`\nfor `U` uniform on the unit interval, and it is *defined* here as that pushforward of\n`uniformMeasure 0 1`. Writing `y = (x - m) / s`, its cumulative distribution function is the\nsigmoid `Real.sigmoid y = (1 + exp (-y))\u207b\u00b9`, its density is\n`exp (-y) / (s * (1 + exp (-y)) ^ 2)`, and its quantile function is\n`u \u21a6 m + s * log (u / (1 - u))`, the map the law was defined by.\n\n**Boundary.** For `s \u2264 0` there is no logistic law: `logisticMeasure m s` and its density are\n*defined* to vanish there (`logisticMeasure_of_nonpos`, `logisticPDFReal_of_nonpos`). The\ndensity presentation `logisticMeasure_eq_withDensity` and the affine transport\n`map_affine_logisticMeasure` hold at every parameter, which is what makes the family measurable\nin its parameters with no case split.\n\n## Main definitions\n\n* `TauCeti.Probability.logisticPDFReal` \u2014 the real-valued density;\n* `TauCeti.Probability.logisticPDF` \u2014 its `\u211d\u22650\u221e`-valued companion;\n* `TauCeti.Probability.logisticMeasure` \u2014 the law, as the image of the standard uniform law under\n `u \u21a6 m + s * log (u / (1 - u))`.\n\n## Main results\n\n* `isProbabilityMeasure_logisticMeasure` \u2014 it is a probability measure when `0 < s`;\n* `hasLaw_logisticMeasure_of_hasLaw_uniformMeasure` \u2014 the logit of a standard uniform variable,\n scaled and shifted, has the logistic law;\n* `cdf_logisticMeasure_eq` \u2014 the cdf is `Real.sigmoid ((x - m) / s)`;\n* `support_logisticMeasure` \u2014 every valid logistic law has full topological support;\n* `logisticMeasure_eq_withDensity`, `hasPDF_of_hasLaw_logisticMeasure`,\n `pdf_eq_logisticPDF_of_hasLaw_logisticMeasure` and `rnDeriv_logisticMeasure` \u2014 the density;\n* `quantile_logisticMeasure` \u2014 the quantile is `m + s * log (u / (1 - u))`;\n* `map_affine_logisticMeasure` and `hasLaw_affine_logisticMeasure` \u2014 the affine image `a + b X`\n of a logistic variable `X` with `b \u2260 0` is logistic with location `a + b * m` and scale\n `|b| * s`;\n* `measurable_logisticMeasure` \u2014 the family is measurable in its two parameters.\n\n## Implementation\n\nThe cdf is computed from the definition: on the open unit interval the logit is strictly\nincreasing with inverse `Real.sigmoid` (`Real.log_div_one_sub_le_iff`), so the event\n`{m + s * log (U / (1 - U)) \u2264 x}` is `{U \u2264 sigmoid ((x - m) / s)}` up to the null endpoint `1`.\nThe density is the derivative of that cdf, so the fundamental theorem of calculus on `Set.Iic x`\nshows that `volume.withDensity logisticPDF` has the same cdf, and two finite measures on `\u211d` with\nthe same cdf agree (`MeasureTheory.Measure.ext_of_Iic`). Affine transport goes through the density\nand `TauCeti.Probability.map_affine_withDensity_volume`; at a negative slope it uses that the\nstandardized density `sigmoid y * (1 - sigmoid y)` is even.\n\n## References\n\n* N. L. Johnson, S. Kotz, N. Balakrishnan, *Continuous Univariate Distributions*, vol. 2, 2nd ed.,\n Wiley (1995), ch. 23.\n-/\n\npublic section\n\nnoncomputable section\n\nopen MeasureTheory ProbabilityTheory Set Filter Topology\n\nopen scoped ENNReal\n\nnamespace TauCeti\n\nnamespace Probability\n\nvariable {m s x : \u211d}\n\n/-! ### The density -/\n\n/-- The density of the logistic law with location `m` and scale `s`, as a real-valued function:\n`exp (-y) / (s * (1 + exp (-y)) ^ 2)` with `y = (x - m) / s`.\n\nFor `s \u2264 0` there is no such law and the density is `0`. -/\ndef logisticPDFReal (m s x : \u211d) : \u211d :=\n if 0 < s then Real.exp (-((x - m) / s)) / (s * (1 + Real.exp (-((x - m) / s))) ^ 2) else 0\n\n/-- The density of the logistic law, as a function valued in `\u211d\u22650\u221e`. -/\ndef logisticPDF (m s x : \u211d) : \u211d\u22650\u221e :=\n ENNReal.ofReal (logisticPDFReal m s x)\n\n/-- The `\u211d\u22650\u221e`-valued logistic density is the coercion of the real-valued one. -/\ntheorem logisticPDF_eq_ofReal (m s x : \u211d) :\n logisticPDF m s x = ENNReal.ofReal (logisticPDFReal m s x) := by\n rw [logisticPDF]\n\n/-- Outside the valid parameter range the density vanishes. -/\n@[simp]\ntheorem logisticPDFReal_of_nonpos (hs : s \u2264 0) (m x : \u211d) : logisticPDFReal m s x = 0 := by\n rw [logisticPDFReal, ite_eq_right (not_lt.mpr hs)]\n\n/-- For a positive scale the density is `exp (-y) / (s * (1 + exp (-y)) ^ 2)` with\n`y = (x - m) / s`. -/\n@[simp]\ntheorem logisticPDFReal_of_pos (hs : 0 < s) (m x : \u211d) :\n logisticPDFReal m s x =\n Real.exp (-((x - m) / s)) / (s * (1 + Real.exp (-((x - m) / s))) ^ 2) := by\n rw [logisticPDFReal, ite_eq_left hs]\n\n/-- For a positive scale the density is `\u03c3 (1 - \u03c3) / s` for the sigmoid `\u03c3` at `(x - m) / s`,\nthat is, the derivative of the cdf `x \u21a6 Real.sigmoid ((x - m) / s)`. -/\ntheorem logisticPDFReal_eq_sigmoid (hs : 0 < s) (m x : \u211d) :\n logisticPDFReal m s x =\n Real.sigmoid ((x - m) / s) * (1 - Real.sigmoid ((x - m) / s)) / s := by\n rw [logisticPDFReal_of_pos hs, Real.sigmoid_mul_one_sub_sigmoid, div_div, mul_comm s]\n\n/-- Outside the valid parameter range the `\u211d\u22650\u221e`-valued density vanishes. -/\n@[simp]\ntheorem logisticPDF_of_nonpos (hs : s \u2264 0) (m x : \u211d) : logisticPDF m s x = 0 := by\n rw [logisticPDF_eq_ofReal, logisticPDFReal_of_nonpos hs, ENNReal.ofReal_zero]\n\n/-- For a positive scale the `\u211d\u22650\u221e`-valued density is the coercion of\n`exp (-y) / (s * (1 + exp (-y)) ^ 2)` with `y = (x - m) / s`. -/\n@[simp]\ntheorem logisticPDF_of_pos (hs : 0 < s) (m x : \u211d) :\n logisticPDF m s x = ENNReal.ofReal\n (Real.exp (-((x - m) / s)) / (s * (1 + Real.exp (-((x - m) / s))) ^ 2)) := by\n rw [logisticPDF_eq_ofReal, logisticPDFReal_of_pos hs]\n\n/-- The logistic density is nonnegative at every parameter, valid or not. -/\ntheorem logisticPDFReal_nonneg (m s x : \u211d) : 0 \u2264 logisticPDFReal m s x := by\n rcases le_or_gt s 0 with hs | hs\n \u00b7 rw [logisticPDFReal_of_nonpos hs]\n \u00b7 rw [logisticPDFReal_of_pos hs]\n positivity\n\n/-- For a positive scale the logistic density is strictly positive everywhere. -/\ntheorem logisticPDFReal_pos (hs : 0 < s) (m x : \u211d) : 0 < logisticPDFReal m s x := by\n rw [logisticPDFReal_of_pos hs]\n positivity\n\n/-- The two logistic densities agree under `ENNReal.toReal`; the density is never infinite. -/\n@[simp]\ntheorem toReal_logisticPDF (m s x : \u211d) : (logisticPDF m s x).toReal = logisticPDFReal m s x :=\n ENNReal.toReal_ofReal (logisticPDFReal_nonneg m s x)\n\n/-- The logistic density is measurable jointly in its location, its scale and the point. -/\n@[fun_prop]\ntheorem measurable_uncurry_logisticPDFReal :\n Measurable fun q : (\u211d \u00d7 \u211d) \u00d7 \u211d => logisticPDFReal q.1.1 q.1.2 q.2 := by\n simp only [logisticPDFReal]\n exact Measurable.ite (measurableSet_lt measurable_const measurable_fst.snd) (by fun_prop)\n measurable_const\n\n/-- The `\u211d\u22650\u221e`-valued logistic density is measurable jointly in its parameters and the point. -/\n@[fun_prop]\ntheorem measurable_uncurry_logisticPDF :\n Measurable fun q : (\u211d \u00d7 \u211d) \u00d7 \u211d => logisticPDF q.1.1 q.1.2 q.2 :=\n measurable_uncurry_logisticPDFReal.ennreal_ofReal\n\n/-- The real-valued logistic density is measurable. -/\n@[fun_prop]\ntheorem measurable_logisticPDFReal (m s : \u211d) : Measurable (logisticPDFReal m s) :=\n measurable_uncurry_logisticPDFReal.comp (measurable_prodMk_left (x := (m, s)))\n\n/-- The `\u211d\u22650\u221e`-valued logistic density is measurable. -/\n@[fun_prop]\ntheorem measurable_logisticPDF (m s : \u211d) : Measurable (logisticPDF m s) :=\n (measurable_logisticPDFReal m s).ennreal_ofReal\n\n/-- The logistic density has exponentially decaying tails: it is at most\n`s\u207b\u00b9 * exp (-(s\u207b\u00b9 * |x - m|))`. -/\nprivate lemma logisticPDFReal_le (hs : 0 < s) (m x : \u211d) :\n logisticPDFReal m s x \u2264 s\u207b\u00b9 * Real.exp (-(s\u207b\u00b9 * |x - m|)) := by\n have key : \u2200 y : \u211d, Real.sigmoid y * (1 - Real.sigmoid y) \u2264 Real.exp (-y) := fun y => by\n rw [Real.sigmoid_mul_one_sub_sigmoid]\n refine div_le_self (Real.exp_pos _).le ?_\n nlinarith [Real.exp_pos (-y)]\n have hy : s\u207b\u00b9 * |x - m| = |(x - m) / s| := by\n rw [abs_div, abs_of_pos hs, inv_mul_eq_div]\n rw [logisticPDFReal_eq_sigmoid hs, div_eq_inv_mul, hy]\n refine mul_le_mul_of_nonneg_left ?_ (inv_nonneg.mpr hs.le)\n rcases le_total 0 ((x - m) / s) with h | h\n \u00b7 rw [abs_of_nonneg h]\n exact key _\n \u00b7 have h' := key (-((x - m) / s))\n rwa [Real.sigmoid_neg, sub_sub_cancel, mul_comm, \u2190 abs_of_nonpos h] at h'\n\n/-- The logistic density is integrable on the whole line for every scale. -/\ntheorem integrable_logisticPDFReal (m s : \u211d) : Integrable (logisticPDFReal m s) := by\n rcases le_or_gt s 0 with hs | hs\n \u00b7 have h : logisticPDFReal m s = fun _ => 0 := funext (logisticPDFReal_of_nonpos hs m)\n rw [h]\n exact integrable_zero \u211d \u211d volume\n \u00b7 have hdom : Integrable fun x : \u211d => s\u207b\u00b9 * Real.exp (-(s\u207b\u00b9 * |x - m|)) :=\n ((TauCeti.integrable_exp_neg_mul_abs (inv_pos.mpr hs)).comp_sub_right m).const_mul _\n refine hdom.mono' (measurable_logisticPDFReal m s).aestronglyMeasurable\n (.of_forall fun x => ?_)\n rw [Real.norm_of_nonneg (logisticPDFReal_nonneg m s x)]\n exact logisticPDFReal_le hs m x\n\n/-- The derivative of the logistic cdf `x \u21a6 Real.sigmoid ((x - m) / s)` is the logistic\ndensity. -/\ntheorem hasDerivAt_sigmoid_logisticPDFReal (hs : 0 < s) (m x : \u211d) :\n HasDerivAt (fun y => Real.sigmoid ((y - m) / s)) (logisticPDFReal m s x) x := by\n have h := (Real.hasDerivAt_sigmoid ((x - m) / s)).comp x\n (((hasDerivAt_id x).sub_const m).div_const s)\n rw [logisticPDFReal_eq_sigmoid hs, div_eq_mul_one_div _ s]\n exact h\n\n/-- The mass of the logistic density below a point is the sigmoid of the standardized point. -/\ntheorem integral_logisticPDFReal_Iic (hs : 0 < s) (m x : \u211d) :\n \u222b y in Iic x, logisticPDFReal m s y = Real.sigmoid ((x - m) / s) := by\n have hlim : Tendsto (fun y => Real.sigmoid ((y - m) / s)) atBot (\ud835\udcdd 0) :=\n Real.tendsto_sigmoid_atBot.comp\n ((tendsto_atBot_add_const_right _ (-m) tendsto_id).atBot_div_const hs)\n rw [integral_Iic_of_hasDerivAt_of_tendsto\n ((hasDerivAt_sigmoid_logisticPDFReal hs m x).continuousAt.continuousWithinAt)\n (fun y _ => hasDerivAt_sigmoid_logisticPDFReal hs m y)\n (integrable_logisticPDFReal m s).integrableOn hlim, sub_zero]\n\n/-! ### The measure -/\n\n/-- The logistic probability measure with location `m` and scale `s`: the law of\n`m + s * log (U / (1 - U))` for `U` uniform on the unit interval.\n\nFor `s \u2264 0` this is the zero measure, not a probability measure; see\n`logisticMeasure_of_nonpos`. -/\ndef logisticMeasure (m s : \u211d) : Measure \u211d :=\n if 0 < s then (uniformMeasure 0 1).map fun u => m + s * Real.log (u / (1 - u)) else 0\n\n/-- For a positive scale the logistic law is the image of the standard uniform law under\n`u \u21a6 m + s * log (u / (1 - u))`. -/\ntheorem logisticMeasure_of_pos (hs : 0 < s) (m : \u211d) :\n logisticMeasure m s = (uniformMeasure 0 1).map fun u => m + s * Real.log (u / (1 - u)) := by\n rw [logisticMeasure, ite_eq_left hs]\n\n/-- Outside the valid parameter range the logistic law is the zero measure. -/\n@[simp]\ntheorem logisticMeasure_of_nonpos (hs : s \u2264 0) (m : \u211d) : logisticMeasure m s = 0 := by\n rw [logisticMeasure, ite_eq_right (not_lt.mpr hs)]\n\n/-- For a positive scale the logistic law is a probability measure. -/\ntheorem isProbabilityMeasure_logisticMeasure (hs : 0 < s) (m : \u211d) :\n IsProbabilityMeasure (logisticMeasure m s) := by\n rw [logisticMeasure_of_pos hs]\n infer_instance\n\n/-- **The logistic law from a uniform variable.** If `U` is uniform on the unit interval, then\n`m + s * log (U / (1 - U))` has the logistic law with location `m` and scale `s > 0`. -/\ntheorem hasLaw_logisticMeasure_of_hasLaw_uniformMeasure {\u03a9 : Type*} [MeasurableSpace \u03a9]\n {P : Measure \u03a9} {U : \u03a9 \u2192 \u211d} (hs : 0 < s) (m : \u211d) (hU : HasLaw U (uniformMeasure 0 1) P) :\n HasLaw (fun \u03c9 => m + s * Real.log (U \u03c9 / (1 - U \u03c9))) (logisticMeasure m s) P := by\n rw [logisticMeasure_of_pos hs]\n exact (hasLaw_map (Real.measurable_logit_affine m s).aemeasurable).comp hU\n\n/-- The logistic law of a lower half-line: the event `{X \u2264 x}` has mass\n`Real.sigmoid ((x - m) / s)`. -/\ntheorem logisticMeasure_Iic (hs : 0 < s) (m x : \u211d) :\n logisticMeasure m s (Iic x) = ENNReal.ofReal (Real.sigmoid ((x - m) / s)) := by\n have hunif : uniformMeasure 0 1 = volume.restrict (Ioo (0 : \u211d) 1) := by\n rw [uniformMeasure_eq_smul, sub_zero, ENNReal.ofReal_one, inv_one, one_smul]\n exact Measure.restrict_congr_set Ioo_ae_eq_Ioc.symm\n have hpre : (fun u => m + s * Real.log (u / (1 - u))) \u207b\u00b9' Iic x \u2229 Ioo 0 1 =\n Ioc 0 (Real.sigmoid ((x - m) / s)) := by\n ext u\n simp only [mem_inter_iff, mem_preimage, mem_Iic, mem_Ioo, mem_Ioc]\n constructor\n \u00b7 rintro \u27e8hle, h0, h1\u27e9\n refine \u27e8h0, (Real.log_div_one_sub_le_iff h0 h1).mp ?_\u27e9\n rw [le_div_iff\u2080 hs]\n linarith\n \u00b7 rintro \u27e8h0, hle\u27e9\n have h1 : u < 1 := hle.trans_lt (Real.sigmoid_lt_one _)\n refine \u27e8?_, h0, h1\u27e9\n have := (Real.log_div_one_sub_le_iff h0 h1).mpr hle\n rw [le_div_iff\u2080 hs] at this\n linarith\n rw [logisticMeasure_of_pos hs,\n Measure.map_apply (Real.measurable_logit_affine m s) measurableSet_Iic, hunif,\n Measure.restrict_apply (Real.measurable_logit_affine m s measurableSet_Iic), hpre,\n Real.volume_Ioc, sub_zero]\n\n/-- **The cdf of the logistic law** is the sigmoid of the standardized point:\n`Real.sigmoid ((x - m) / s) = (1 + exp (-(x - m) / s))\u207b\u00b9`. -/\ntheorem cdf_logisticMeasure_eq (hs : 0 < s) (m x : \u211d) :\n cdf (logisticMeasure m s) x = Real.sigmoid ((x - m) / s) := by\n have := isProbabilityMeasure_logisticMeasure hs m\n rw [cdf_eq_real, measureReal_def, logisticMeasure_Iic hs,\n ENNReal.toReal_ofReal (Real.sigmoid_nonneg _)]\n\n/-- The cdf of a valid logistic law is strictly increasing. -/\ntheorem strictMono_cdf_logisticMeasure (hs : 0 < s) (m : \u211d) :\n StrictMono (cdf (logisticMeasure m s)) := by\n intro x y hxy\n rw [cdf_logisticMeasure_eq hs, cdf_logisticMeasure_eq hs]\n exact Real.sigmoid_strictMono (div_lt_div_of_pos_right (sub_lt_sub_right hxy m) hs)\n\n/-- The cdf of a valid logistic law is continuous. -/\ntheorem continuous_cdf_logisticMeasure (hs : 0 < s) (m : \u211d) :\n Continuous (cdf (logisticMeasure m s)) := by\n have hfun : cdf (logisticMeasure m s) = fun x \u21a6 Real.sigmoid ((x - m) / s) :=\n funext (cdf_logisticMeasure_eq hs m)\n rw [hfun]\n fun_prop\n\n/-- A valid logistic law has full topological support; an invalid law has empty support. -/\n@[simp]\ntheorem support_logisticMeasure (m s : \u211d) :\n (logisticMeasure m s).support = if 0 < s then Set.univ else \u2205 := by\n by_cases hs : 0 < s\n \u00b7 rw [ite_eq_left hs]\n let _ := isProbabilityMeasure_logisticMeasure hs m\n exact Measure.support_eq_univ_of_strictMono_cdf _ (strictMono_cdf_logisticMeasure hs m)\n \u00b7 rw [ite_eq_right hs, logisticMeasure_of_nonpos (le_of_not_gt hs), Measure.support_zero]\n\n/-! ### The density of the measure -/\n\n", "statement": "/-- **The density of the logistic law.** The logistic law is `volume.withDensity logisticPDF`, at\nevery parameter: for `s \u2264 0` both sides are zero. -/\ntheorem logisticMeasure_eq_withDensity (m s : \u211d) :\n logisticMeasure m s = volume.withDensity (logisticPDF m s) ", "proof": " by\n rcases le_or_gt s 0 with hs | hs\n \u00b7 have h : logisticPDF m s = 0 := funext fun x => by\n rw [logisticPDF_of_nonpos hs, Pi.zero_apply]\n rw [logisticMeasure_of_nonpos hs, h, withDensity_zero]\n \u00b7 have := isProbabilityMeasure_logisticMeasure hs m\n refine Measure.ext_of_Iic _ _ fun x => ?_\n have hpdf : logisticPDF m s = fun y => ENNReal.ofReal (logisticPDFReal m s y) :=\n funext (logisticPDF_eq_ofReal m s)\n rw [logisticMeasure_Iic hs, withDensity_apply _ measurableSet_Iic, hpdf,\n \u2190 ofReal_integral_eq_lintegral_ofReal (integrable_logisticPDFReal m s).integrableOn\n (.of_forall (logisticPDFReal_nonneg m s)), integral_logisticPDFReal_Iic hs]", "proof_lines": 11, "proof_length": 631, "rev": "75c8aed5fea63047615a25a9763fd5b68a86e891", "heartbeats": 279, "image": "lean-compression:tauceti-75c8aed5fe-a608030cfc", "split": "dev"} {"path": "TauCeti/Probability/RandomMatrix/SampleCovariance/Cutoff.lean", "module": "TauCeti.Probability.RandomMatrix.SampleCovariance.Cutoff", "theorem": "TauCeti.Probability.measureReal_norm_integral_comp_sqrt_spectralMeasure_sampleCovariance_sub_ge_le", "prefix": "/-\nCopyright (c) 2026 The Tau Ceti contributors. All rights reserved.\nReleased under Apache 2.0 license as described in the file LICENSE.\nAuthors: The Tau Ceti contributors\n-/\nmodule\n\npublic import TauCeti.Analysis.Matrix.SpectralMeasure.CovariancePerturbation\npublic import TauCeti.MeasureTheory.Function.LpSeminorm.Truncation\npublic import Mathlib.Probability.IdentDistrib\n\nimport TauCeti.Probability.RandomMatrix.Frobenius\n\n/-!\n# Bounded approximation of sample covariance matrices\n\nCutting off the entries of a data matrix at a fixed norm level approximates its covariance\nspectral statistics in probability, uniformly in both matrix dimensions. Only a finite second\nabsolute moment of the common entry law is needed; the entries need not be independent.\n\nThe tests are Lipschitz functions of the square roots of covariance eigenvalues. These are\nthe singular values of the normalized data matrix, with row normalization and all forced\nzeros retained. The deterministic weak-convergence criterion relates convergence of these\nsingular-value laws to convergence of the covariance spectral laws. The bounds apply to all\nLipschitz tests, including bounded Lipschitz tests.\n\nThe finite perturbation bound applies to any coupling of two data matrices. Its common-error-law\nform is consumed by the cutoff estimate and its uniform limit. Cutoff zero and empty samples\nare included. Centering the cutoff entries is a separate operation.\n\n## References\n\n* Z. Bai and J. Silverstein, *Spectral Analysis of Large Dimensional Random Matrices*,\n second edition, Springer, 2010, \u00a73.3 and Appendix A.\n-/\n\npublic section\n\nnoncomputable section\n\nopen MeasureTheory ProbabilityTheory Filter\nopen scoped Matrix.Norms.Frobenius NNReal Topology ENNReal\n\nnamespace TauCeti.Probability\n\nvariable {\u03a9 \ud835\udd5c E : Type*} [MeasurableSpace \u03a9] {P : Measure \u03a9}\n [RCLike \ud835\udd5c] [MeasurableSpace \ud835\udd5c] [BorelSpace \ud835\udd5c]\n [NormedAddCommGroup E] [NormedSpace \u211d E]\n {p n : Type*} [Fintype p] [Fintype n] [DecidableEq p] [Nonempty p]\n\n", "statement": "omit [MeasurableSpace \ud835\udd5c] [BorelSpace \ud835\udd5c] in\n/-- A mean squared data perturbation controls the probability of a change in any Lipschitz\nsquare-root covariance statistic. No independence or measurability of the two matrices is\nneeded beyond integrability of their squared Frobenius difference. -/\ntheorem measureReal_norm_integral_comp_sqrt_spectralMeasure_sampleCovariance_sub_ge_le\n (X Y : \u03a9 \u2192 Matrix p n \ud835\udd5c) (hXY : Integrable (fun \u03c9 \u21a6 \u2016X \u03c9 - Y \u03c9\u2016 ^ 2) P)\n {K : \u211d\u22650} {f : \u211d \u2192 E} (hf : LipschitzWith K f) {\u03b5 : \u211d} (h\u03b5 : 0 < \u03b5) :\n P.real {\u03c9 | \u03b5 \u2264 \u2016\u222b x, f (Real.sqrt x)\n \u2202((X \u03c9).sampleCovariance.spectralMeasure\n (Matrix.isHermitian_sampleCovariance _) : Measure \u211d) -\n \u222b x, f (Real.sqrt x)\n \u2202((Y \u03c9).sampleCovariance.spectralMeasure\n (Matrix.isHermitian_sampleCovariance _) : Measure \u211d)\u2016}\n \u2264 (K : \u211d) ^ 2 * (\u222b \u03c9, \u2016X \u03c9 - Y \u03c9\u2016 ^ 2 \u2202P) /\n (Fintype.card p * Fintype.card n * \u03b5 ^ 2) ", "proof": " by\n let g (\u03c9 : \u03a9) := (K : \u211d) ^ 2 * \u2016X \u03c9 - Y \u03c9\u2016 ^ 2 /\n (Fintype.card p * Fintype.card n)\n have hg : Integrable g P := (hXY.const_mul _).div_const _\n have hsub : {\u03c9 | \u03b5 \u2264 \u2016\u222b x, f (Real.sqrt x)\n \u2202((X \u03c9).sampleCovariance.spectralMeasure\n (Matrix.isHermitian_sampleCovariance _) : Measure \u211d) -\n \u222b x, f (Real.sqrt x)\n \u2202((Y \u03c9).sampleCovariance.spectralMeasure\n (Matrix.isHermitian_sampleCovariance _) : Measure \u211d)\u2016}\n \u2286 {\u03c9 | \u03b5 ^ 2 \u2264 g \u03c9} := by\n intro \u03c9 h\u03c9\n exact (pow_le_pow_left\u2080 h\u03b5.le h\u03c9 2).trans\n (Matrix.sq_norm_integral_comp_sqrt_spectralMeasure_sampleCovariance_sub_le (X \u03c9) (Y \u03c9) hf)\n have hmarkov := mul_meas_ge_le_integral_of_nonneg\n (\u03bc := P) (f := g) (Eventually.of_forall fun _ \u21a6 by positivity) hg (\u03b5 ^ 2)\n rw [\u2190 div_div]\n apply (le_div_iff\u2080 (sq_pos_of_pos h\u03b5)).2\n calc\n _ \u2264 P.real {\u03c9 | \u03b5 ^ 2 \u2264 g \u03c9} * \u03b5 ^ 2 :=\n mul_le_mul_of_nonneg_right\n (measureReal_mono hsub (hg.measure_ge_lt_top (sq_pos_of_pos h\u03b5)).ne) (sq_nonneg \u03b5)\n _ \u2264 \u222b \u03c9, g \u03c9 \u2202P := by linarith\n _ = _ := by simp only [g, integral_div, integral_const_mul]", "proof_lines": 23, "proof_length": 995, "rev": "75c8aed5fea63047615a25a9763fd5b68a86e891", "heartbeats": 2681, "image": "lean-compression:tauceti-75c8aed5fe-a608030cfc", "split": "dev"} {"path": "TauCeti/Probability/RandomMatrix/SampleCovariance/Trace/Integrability.lean", "module": "TauCeti.Probability.RandomMatrix.SampleCovariance.Trace.Integrability", "theorem": "TauCeti.Probability.memLp_trace_pow_sampleCovariance", "prefix": "/-\nCopyright (c) 2026 The Tau Ceti contributors. All rights reserved.\nReleased under Apache 2.0 license as described in the file LICENSE.\nAuthors: The Tau Ceti contributors\n-/\nmodule\n\npublic import TauCeti.Analysis.Matrix.SampleSecondMoment\npublic import Mathlib.MeasureTheory.Function.L1Space.Integrable\nimport TauCeti.Data.ENNReal.Inv\nimport TauCeti.Probability.RandomMatrix.Integrability\n\n/-!\n# Integrability of traces of sample covariance powers\n\nEach entry of the sample covariance matrix `X X\u1d34 / n` of a random rectangular matrix `X` is a\nscaled sum of products of an entry of `X` and a conjugate entry. By H\u00f6lder's inequality these\nentries lie in `L^(q * k)` when the entries of `X` lie in `L^(q * 2k)`, so the trace of the\n`k`th power of the sample covariance matrix lies in `L^q` (`TauCeti.memLp_trace_pow`). Neither\nindependence nor centering is needed. The theorems assume a finite measure when `k = 0`.\n\n## Main results\n\n* `TauCeti.Probability.memLp_trace_pow_sampleCovariance`: with entries in `L^(q * 2k)`, the\n trace of the `k`th power of the sample covariance matrix lies in `L^q`.\n* `TauCeti.Probability.integrable_trace_pow_sampleCovariance`: with entries in `L^(2k)`, it is\n integrable.\n-/\n\npublic section\n\nopen MeasureTheory Matrix\nopen scoped ENNReal\n\nnamespace TauCeti.Probability\n\nvariable {\u03a9 \ud835\udd5c p n : Type*} [MeasurableSpace \u03a9] [RCLike \ud835\udd5c] {P : Measure \u03a9}\n {X : \u03a9 \u2192 Matrix p n \ud835\udd5c} {k : \u2115}\n\n", "statement": "/-- The trace of the `k`th power of the sample covariance matrix of `X` lies in `L^q` whenever all\nentries of `X` lie in `L^(q * 2k)`. The measure is assumed finite when `k = 0`. Neither\nindependence nor centering is required. -/\ntheorem memLp_trace_pow_sampleCovariance [Fintype p] [Fintype n] [DecidableEq p] {q : \u211d\u22650\u221e}\n (hP : k = 0 \u2192 IsFiniteMeasure P) (hX : \u2200 a b, MemLp (fun \u03c9 \u21a6 X \u03c9 a b) (q * (2 * k : \u2115)) P) :\n MemLp (fun \u03c9 \u21a6 ((X \u03c9).sampleCovariance ^ k).trace) q P ", "proof": " by\n -- Each entry is a scaled sum of products of two entries, which lie in `L^(q * k)` by H\u00f6lder.\n have hexp : ((q * (2 * k : \u2115))\u207b\u00b9 + (q * (2 * k : \u2115))\u207b\u00b9)\u207b\u00b9 = q * k := by\n have h2 : q * ((2 * k : \u2115) : \u211d\u22650\u221e) = q * k * 2 := by\n push_cast\n ring\n rw [\u2190 two_mul, h2, ENNReal.inv_mul_inv_mul_cancel two_ne_zero ENNReal.ofNat_ne_top]\n have : ENNReal.HolderTriple (q * (2 * k : \u2115)) (q * (2 * k : \u2115)) (q * k) :=\n hexp \u25b8 ENNReal.HolderTriple.of _ _\n refine memLp_trace_pow hP fun a b \u21a6 ?_\n simp only [sampleCovariance_apply]\n exact (memLp_finsetSum _ fun c _ \u21a6 (hX a c).mul (r := q * k) (hX b c).star).const_smul\n (1 / (Fintype.card n : \u211d))", "proof_lines": 12, "proof_length": 524, "rev": "75c8aed5fea63047615a25a9763fd5b68a86e891", "heartbeats": 1720, "image": "lean-compression:tauceti-75c8aed5fe-a608030cfc", "split": "dev"} {"path": "TauCeti/Probability/Distributions/NegativeHypergeometric/Support.lean", "module": "TauCeti.Probability.Distributions.NegativeHypergeometric.Support", "theorem": "TauCeti.Probability.support_negativeHypergeometricMeasure_of_pos", "prefix": "/-\nCopyright (c) 2026 The Tau Ceti contributors. All rights reserved.\nReleased under Apache 2.0 license as described in the file LICENSE.\nAuthors: The Tau Ceti contributors\n-/\nmodule\n\npublic import TauCeti.MeasureTheory.Measure.Dirac\npublic import TauCeti.MeasureTheory.Measure.Support\npublic import TauCeti.Probability.Distributions.NegativeHypergeometric.Basic\n\n/-!\n# Topological support of the negative hypergeometric distribution\n\nFor valid parameters and a positive number `r` of awaited successes, every failure count from\n`0` through `N - K` has positive mass. Thus the native negative hypergeometric law has support\n`Set.Icc 0 (N - K)`. When `r = 0` its support is the singleton zero, while invalid parameters\ngive the empty support because the totalized measure is zero.\n\nThe real-cast law has the corresponding finite set of nonnegative integer points as its support.\nThese support formulas distinguish the finite native carrier from the whole real interval between\nits endpoints.\n\n## Main results\n\n* `TauCeti.Probability.support_negativeHypergeometricMeasure` gives the exact totalized native\n support.\n* `TauCeti.Probability.support_map_cast_negativeHypergeometricMeasure` gives the support after\n casting the count to `\u211d`.\n-/\n\npublic section\n\nnoncomputable section\n\nopen MeasureTheory Set\n\nnamespace TauCeti.Probability\n\n", "statement": "/-- At valid parameters with a positive awaited-success count, the native negative\nhypergeometric law has support exactly `0, \u2026, N - K`. -/\ntheorem support_negativeHypergeometricMeasure_of_pos {N K r : \u2115} (hr : r \u2264 K)\n (hK : K \u2264 N) (hr0 : 0 < r) :\n (negativeHypergeometricMeasure N K r).support = Icc 0 (N - K) ", "proof": " by\n ext k\n rw [Measure.mem_support_iff_forall]\n constructor\n \u00b7 intro hk\n have hmass : negativeHypergeometricMeasure N K r {k} \u2260 0 :=\n (hk {k} (by simp)).ne'\n exact mem_Icc.mpr \u27e8Nat.zero_le k,\n ((negativeHypergeometricMeasure_singleton_ne_zero_iff hr hK k).mp hmass).1\u27e9\n \u00b7 intro hk U hU\n have hmass : 0 < negativeHypergeometricMeasure N K r {k} :=\n pos_iff_ne_zero.mpr <|\n (negativeHypergeometricMeasure_singleton_ne_zero_iff hr hK k).mpr\n \u27e8hk.2, Or.inr hr0\u27e9\n exact hmass.trans_le <| measure_mono <|\n singleton_subset_iff.mpr (mem_of_mem_nhds hU)", "proof_lines": 15, "proof_length": 530, "rev": "75c8aed5fea63047615a25a9763fd5b68a86e891", "heartbeats": 198, "image": "lean-compression:tauceti-75c8aed5fe-a608030cfc", "split": "dev"} {"path": "TauCeti/Probability/Distributions/ChiSquared/Quantile.lean", "module": "TauCeti.Probability.Distributions.ChiSquared.Quantile", "theorem": "TauCeti.Probability.tendsto_quantile_map_const_mul_chiSquaredMeasure_nhdsLT_one", "prefix": "/-\nCopyright (c) 2026 The Tau Ceti contributors. All rights reserved.\nReleased under Apache 2.0 license as described in the file LICENSE.\nAuthors: Codex\n-/\nmodule\n\npublic import TauCeti.Probability.Distributions.ChiSquared.Basic\npublic import TauCeti.Probability.Distributions.Gamma.Quantile\npublic import TauCeti.Probability.Quantile.Map\npublic import Mathlib.Topology.Instances.EReal.Lemmas\n\n/-!\n# Quantiles of chi-squared laws\n\nFor nonnegative degrees of freedom `k` and an interior level `u`, the chi-squared quantile is\n`2 * inverseRegularizedGamma (k / 2) u`. This includes the zero-degree law, which is the Dirac\nmass at zero.\n\nThe one-sided endpoint limits are stated in `EReal`. Every nonnegative-degree law has lower\nendpoint zero. At the upper endpoint, a positive-degree law is unbounded, while the zero-degree\nlaw remains at zero.\n\nScaling by a nonnegative factor `c` multiplies the quantile by `c`. The scaled laws are the\ndiagonal laws of Wishart matrices; their upper endpoint limit is infinite unless the factor or\nthe degree vanishes, when the law is the Dirac mass at zero.\n\n## Main results\n\n* `TauCeti.Probability.quantile_chiSquaredMeasure` gives the quantile formula, including the\n zero-degree boundary;\n* `TauCeti.Probability.tendsto_quantile_chiSquaredMeasure_nhdsGT_zero` and\n `TauCeti.Probability.tendsto_quantile_chiSquaredMeasure_nhdsLT_one` give the endpoint limits;\n* `TauCeti.Probability.quantile_map_const_mul_chiSquaredMeasure` gives the quantile of a scaled\n chi-squared law.\n-/\n\npublic section\n\nnoncomputable section\n\nopen Filter MeasureTheory ProbabilityTheory Set Topology\n\nnamespace TauCeti.Probability\n\nvariable {c k u : \u211d}\n\n/-- The quantile of a chi-squared law with nonnegative degrees of freedom, including the\nzero-degree Dirac boundary. -/\n@[simp]\ntheorem quantile_chiSquaredMeasure (hk : 0 \u2264 k) (hu : u \u2208 Ioo 0 1) :\n (chiSquaredMeasure k).quantile u = 2 * inverseRegularizedGamma (k / 2) u := by\n rcases hk.eq_or_lt' with rfl | hk\n \u00b7 rw [chiSquaredMeasure_zero, Measure.quantile_dirac 0 hu.1 hu.2.le]\n simp\n \u00b7 rw [chiSquaredMeasure_eq_gammaMeasure hk,\n quantile_gammaMeasure (half_pos hk) one_half_pos]\n ring\n\n/-- Chi-squared quantiles approach the lower support endpoint zero as the level tends to zero\nfrom above, including at zero degrees of freedom. -/\ntheorem tendsto_quantile_chiSquaredMeasure_nhdsGT_zero (hk : 0 \u2264 k) :\n Tendsto (fun u \u21a6 ((chiSquaredMeasure k).quantile u : EReal))\n (nhdsWithin 0 (Ioi 0)) (nhds 0) := by\n rcases hk.eq_or_lt' with rfl | hk\n \u00b7 apply tendsto_const_nhds.congr'\n filter_upwards [Ioo_mem_nhdsGT zero_lt_one] with u hu\n rw [chiSquaredMeasure_zero, Measure.quantile_dirac 0 hu.1 hu.2.le]\n norm_num\n \u00b7 rw [chiSquaredMeasure_eq_gammaMeasure hk]\n exact EReal.tendsto_coe.2\n ((tendsto_quantile_gammaMeasure_nhdsGT_zero (half_pos hk) one_half_pos).mono_right\n inf_le_left)\n\n/-- At positive degrees of freedom, chi-squared quantiles tend to positive infinity as the level\ntends to one from below; at zero degrees of freedom they remain at zero. -/\ntheorem tendsto_quantile_chiSquaredMeasure_nhdsLT_one (hk : 0 \u2264 k) :\n Tendsto (fun u \u21a6 ((chiSquaredMeasure k).quantile u : EReal))\n (nhdsWithin 1 (Iio 1)) (nhds (if k = 0 then 0 else \u22a4)) := by\n rcases hk.eq_or_lt' with rfl | hk\n \u00b7 rw [ite_eq_left rfl]\n apply tendsto_const_nhds.congr'\n filter_upwards [Ioo_mem_nhdsLT zero_lt_one] with u hu\n rw [chiSquaredMeasure_zero, Measure.quantile_dirac 0 hu.1 hu.2.le]\n norm_num\n \u00b7 rw [ite_eq_right hk.ne', chiSquaredMeasure_eq_gammaMeasure hk,\n EReal.tendsto_coe_nhds_top_iff]\n exact tendsto_quantile_gammaMeasure_nhdsLT_one (half_pos hk) one_half_pos\n\n/-- The quantile of a chi-squared law scaled by a nonnegative factor, including the Dirac\nboundaries at zero factor and at zero degrees of freedom. -/\n@[simp]\ntheorem quantile_map_const_mul_chiSquaredMeasure (hc : 0 \u2264 c) (hk : 0 \u2264 k) (hu : u \u2208 Ioo 0 1) :\n ((chiSquaredMeasure k).map (c * \u00b7)).quantile u =\n c * (2 * inverseRegularizedGamma (k / 2) u) := by\n have := isProbabilityMeasure_chiSquaredMeasure hk\n rw [Measure.quantile_map_const_mul hc hu.1 hu.2, quantile_chiSquaredMeasure hk hu]\n\n/-- Quantiles of a chi-squared law scaled by a nonnegative factor tend to zero as the level\ntends to zero from above. -/\ntheorem tendsto_quantile_map_const_mul_chiSquaredMeasure_nhdsGT_zero (hc : 0 \u2264 c)\n (hk : 0 \u2264 k) :\n Tendsto (fun u \u21a6 (((chiSquaredMeasure k).map (c * \u00b7)).quantile u : EReal))\n (\ud835\udcdd[>] 0) (\ud835\udcdd 0) := by\n have h := (EReal.tendsto_coe.1 (tendsto_quantile_chiSquaredMeasure_nhdsGT_zero hk)).const_mul c\n rw [mul_zero] at h\n refine (EReal.tendsto_coe.2 h).congr' ?_\n filter_upwards [Ioo_mem_nhdsGT zero_lt_one] with u hu\n rw [quantile_map_const_mul_chiSquaredMeasure hc hk hu, quantile_chiSquaredMeasure hk hu]\n\n", "statement": "/-- Quantiles of a chi-squared law scaled by a nonnegative factor tend to positive infinity as\nthe level tends to one from below, unless the factor or the degree vanishes, when they remain at\nzero. -/\ntheorem tendsto_quantile_map_const_mul_chiSquaredMeasure_nhdsLT_one (hc : 0 \u2264 c)\n (hk : 0 \u2264 k) :\n Tendsto (fun u \u21a6 (((chiSquaredMeasure k).map (c * \u00b7)).quantile u : EReal))\n (\ud835\udcdd[<] 1) (\ud835\udcdd (if c = 0 \u2228 k = 0 then 0 else \u22a4)) ", "proof": " by\n by_cases h0 : c = 0 \u2228 k = 0\n \u00b7 rw [ite_eq_left h0]\n refine tendsto_const_nhds.congr' ?_\n filter_upwards [Ioo_mem_nhdsLT zero_lt_one] with u hu\n rw [quantile_map_const_mul_chiSquaredMeasure hc hk hu]\n rcases h0 with rfl | rfl <;> simp\n \u00b7 rw [ite_eq_right h0]\n push Not at h0\n have hk' : k \u2260 0 := h0.2\n have h := tendsto_quantile_chiSquaredMeasure_nhdsLT_one hk\n rw [ite_eq_right hk', EReal.tendsto_coe_nhds_top_iff] at h\n refine EReal.tendsto_coe_nhds_top_iff.2\n ((h.const_mul_atTop (lt_of_le_of_ne hc (Ne.symm h0.1))).congr' ?_)\n filter_upwards [Ioo_mem_nhdsLT zero_lt_one] with u hu\n rw [quantile_map_const_mul_chiSquaredMeasure hc hk hu, quantile_chiSquaredMeasure hk hu]", "proof_lines": 15, "proof_length": 662, "rev": "75c8aed5fea63047615a25a9763fd5b68a86e891", "heartbeats": 606, "image": "lean-compression:tauceti-75c8aed5fe-a608030cfc", "split": "dev"} {"path": "TauCeti/Algebra/AlgebraicGroup/ProjectiveGeneralLinear/Tangent/Basic.lean", "module": "TauCeti.Algebra.AlgebraicGroup.ProjectiveGeneralLinear.Tangent.Basic", "theorem": "TauCeti.ProjectiveGeneralLinear.mem_range_tangentEnd_iff_leibniz", "prefix": "/-\nCopyright (c) 2026 The Tau Ceti contributors. All rights reserved.\nReleased under Apache 2.0 license as described in the file LICENSE.\nAuthors: Codex\n-/\nmodule\n\npublic import TauCeti.Algebra.AlgebraicGroup.ProjectiveGeneralLinear.Conjugation\npublic import TauCeti.Algebra.AlgebraicGroup.Tangent.Antipode\npublic import TauCeti.Algebra.AlgebraicGroup.ConstantMultiplication.Tangent\npublic import TauCeti.LinearAlgebra.Matrix.Derivation\n\n/-!\n# The Lie algebra of the projective general linear group\n\nThe tangent Lie algebra of `PGL\u2099`, represented as the automorphism group of the matrix\nalgebra, acts on that algebra by associative derivations. Every such derivation is inner.\nThus its image in the endomorphism algebra is exactly the space of commutators with matrices,\nwithout a restriction on the characteristic or on the rank. Coefficients may lie in any\ncommutative algebra over the base ring.\n\nThe construction uses the closed-subgroup tangent equivalence and the tangent-matrix\nidentification for `GL`. The linearized multiplication relations characterize its image.\n`tangentLieEquivInnerDerivations` identifies it with the range of the adjoint action on\nthe matrix algebra, bundled as a Lie subalgebra of its endomorphisms.\n\n## References\n\n* J. S. Milne, *Algebraic Groups* (2017), \u00a710, tangent spaces of automorphism groups.\n* N. Jacobson, *Basic Algebra II*, inner derivations of matrix algebras.\n-/\n\npublic section\n\nopen Matrix\n\nnamespace TauCeti.ProjectiveGeneralLinear\n\nuniverse u v\n\nattribute [local instance 100] LieRing.ofAssociativeRing\n\nnoncomputable section\n\nvariable (n : \u2115) {R : Type u} [CommRing R] {B : Type v} [CommRing B] [Algebra R B]\n\n/-- The tangent action of the projective general linear group on its matrix algebra.\nIt is the differential of its defining inclusion into `GL_{n\u00b2}`, expressed in the\nmatrix-unit basis. -/\ndef tangentEnd :\n Derivation R (coordinateHopfAlgebra n R)\n (Bialgebra.CounitAlgebra R (coordinateHopfAlgebra n R) B) \u2192\u2097\u2045B\u2046\n Module.End B (Matrix (Fin n) (Fin n) B) :=\n ((Matrix.toLinAlgEquiv (matrixUnitBasis n B)).toLieEquiv.toLieHom).comp\n ((GeneralLinear.tangentLieEquivMatrix (R := R) (B := B) (n * n)).toLieHom.comp\n (HopfIdeal.quotientLieHom (B := B) (definingHopfIdeal n R)))\n\n/-- The tangent action is the endomorphism represented by the ambient tangent matrix. -/\n@[simp]\ntheorem tangentEnd_apply\n (d : Derivation R (coordinateHopfAlgebra n R)\n (Bialgebra.CounitAlgebra R (coordinateHopfAlgebra n R) B)) :\n tangentEnd n d = Matrix.toLinAlgEquiv (matrixUnitBasis n B)\n (GeneralLinear.tangentMatrix (n * n)\n (HopfIdeal.quotientLieHom (definingHopfIdeal n R) d)) := by\n simp [tangentEnd, GeneralLinear.tangentLieEquivMatrix_apply]\n\n/-- An inner representative gives the ambient tangent matrix by the two Kronecker\nmultiplication matrices. This formula does not require a choice of normalization. -/\ntheorem tangentMatrix_eq_of_tangentEnd_eq\n (d : Derivation R (coordinateHopfAlgebra n R)\n (Bialgebra.CounitAlgebra R (coordinateHopfAlgebra n R) B))\n (X : Matrix (Fin n) (Fin n) B)\n (hd : tangentEnd (R := R) n d = LinearMap.mulLeft B X - LinearMap.mulRight B X) :\n GeneralLinear.tangentMatrix (n * n)\n (HopfIdeal.quotientLieHom (definingHopfIdeal n R) d) =\n conjugationMatrix X 1 - conjugationMatrix 1 X := by\n apply (Matrix.toLinAlgEquiv (matrixUnitBasis n B)).injective\n rw [\u2190 tangentEnd_apply, hd, map_sub]\n simp\n\nprivate theorem tangentMatrix_conjugationMap_eq_map\n (d : Derivation R (GeneralLinear.coordinateHopfAlgebra R n)\n (Bialgebra.CounitAlgebra R (GeneralLinear.coordinateHopfAlgebra R n) B)) :\n GeneralLinear.tangentMatrix (n * n)\n (HopfIdeal.quotientLieHom (definingHopfIdeal n R)\n (derivationComp (B := B) (conjugationMap n R).hom d)) =\n (conjugationMatrix (GeneralLinear.genericMatrix R n)\n (GeneralLinear.genericMatrix R n)\u207b\u00b9).map\n (fun x \u21a6 Bialgebra.CounitAlgebra.algEquivSelf R\n (GeneralLinear.coordinateHopfAlgebra R n) B (d x)) := by\n -- Differentiate the coordinate matrix identity before evaluating individual entries.\n rw [\u2190 map_genericMatrix_conjugationMap, Matrix.map_map]\n ext a b\n -- Use the bialgebra-hom coercion on both sides of the transported identity.\n simp only [HopfIdeal.quotientLieHom_apply, \u2190 LinearMap.comp_apply, \u2190 derivationComp_comp,\n GeneralLinear.tangentMatrix_apply, algEquivSelf_derivationComp_apply,\n Matrix.map_apply, Function.comp_apply, GeneralLinear.genericMatrix_apply,\n CommHopfAlgCat.hom_comp, CommHopfAlgCat.hom_mkQuotient, BialgHom.coe_comp,\n BialgHom.coe_toAlgHom]\n\nprivate theorem map_derivation_conjugationMatrix_genericMatrix\n (d : Derivation R (GeneralLinear.coordinateHopfAlgebra R n)\n (Bialgebra.CounitAlgebra R (GeneralLinear.coordinateHopfAlgebra R n) B)) :\n (conjugationMatrix (GeneralLinear.genericMatrix R n)\n (GeneralLinear.genericMatrix R n)\u207b\u00b9).map\n (fun x \u21a6 Bialgebra.CounitAlgebra.algEquivSelf R\n (GeneralLinear.coordinateHopfAlgebra R n) B (d x)) =\n conjugationMatrix (GeneralLinear.tangentMatrix n d) 1 -\n conjugationMatrix 1 (GeneralLinear.tangentMatrix n d) := by\n classical\n ext a b\n -- Leibniz differentiates the two factors; inversion contributes the negative sign.\n rw [Matrix.map_apply, \u2190 GeneralLinear.map_antipode_genericMatrix, conjugationMatrix_apply,\n Matrix.map_apply, HopfAlgebra.antipodeAlgHom_apply,\n Bialgebra.CounitAlgebra.algEquivSelf_apply_mul, d.apply_antipode]\n simp only [HopfAlgebra.counit_antipode, map_neg,\n \u2190 GeneralLinear.tangentMatrix_apply, conjugationMatrix_apply, Matrix.sub_apply,\n GeneralLinear.genericMatrix_apply, GeneralLinear.coordinateHopfAlgebra_counit_X,\n Matrix.one_apply]\n split_ifs <;>\n simp only [map_one, map_zero, one_mul, zero_mul, mul_one, mul_zero,\n sub_eq_add_neg, neg_zero, zero_add, add_zero, add_comm]\n\n/-- The differential of conjugation, in the matrix-unit basis, is the matrix of the\ncommutator with the general-linear tangent matrix. -/\n@[simp]\ntheorem tangentMatrix_quotientLieHom_derivationComp_conjugationMap\n (d : Derivation R (GeneralLinear.coordinateHopfAlgebra R n)\n (Bialgebra.CounitAlgebra R (GeneralLinear.coordinateHopfAlgebra R n) B)) :\n GeneralLinear.tangentMatrix (n * n)\n (HopfIdeal.quotientLieHom (definingHopfIdeal n R)\n (derivationComp (B := B) (conjugationMap n R).hom d)) =\n conjugationMatrix (GeneralLinear.tangentMatrix n d) 1 -\n conjugationMatrix 1 (GeneralLinear.tangentMatrix n d) := by\n rw [tangentMatrix_conjugationMap_eq_map, map_derivation_conjugationMatrix_genericMatrix]\n\n/-- The differential of `GL\u2099 \u2192 PGL\u2099` sends a tangent matrix `X` to the inner\nderivation `Y \u21a6 X Y - Y X` of the matrix algebra. -/\n@[simp]\ntheorem tangentEnd_derivationComp_conjugationMap\n (d : Derivation R (GeneralLinear.coordinateHopfAlgebra R n)\n (Bialgebra.CounitAlgebra R (GeneralLinear.coordinateHopfAlgebra R n) B)) :\n tangentEnd n (derivationComp (B := B) (conjugationMap n R).hom d) =\n LinearMap.mulLeft B (GeneralLinear.tangentMatrix n d) -\n LinearMap.mulRight B (GeneralLinear.tangentMatrix n d) := by\n rw [tangentEnd_apply, tangentMatrix_quotientLieHom_derivationComp_conjugationMap]\n simp only [map_sub, toLinAlgEquiv_conjugationMatrix,\n LinearMap.mulLeft_one, LinearMap.mulRight_one, LinearMap.comp_id, LinearMap.id_comp]\n\n/-- The action of the tangent Lie algebra on the matrix algebra is faithful. -/\ntheorem tangentEnd_injective : Function.Injective (tangentEnd (R := R) (B := B) n) :=\n (Matrix.toLinAlgEquiv (matrixUnitBasis n B)).injective.comp\n ((GeneralLinear.tangentLieEquivMatrix (R := R) (B := B) (n * n)).injective.comp\n (HopfIdeal.quotientLieHom_injective (B := B) (definingHopfIdeal n R)))\n\n", "statement": "/-- A linear endomorphism of the matrix algebra comes from a tangent vector of `PGL\u2099`\nexactly when it satisfies the associative Leibniz rule. -/\ntheorem mem_range_tangentEnd_iff_leibniz\n (f : Module.End B (Matrix (Fin n) (Fin n) B)) :\n f \u2208 Set.range (tangentEnd (R := R) n) \u2194\n \u2200 x y, f (x * y) = f x * y + x * f y ", "proof": " by\n let e := GeneralLinear.tangentLieEquivMatrix (R := R) (B := B) (n * n)\n let X := LinearMap.toMatrix (matrixUnitBasis n B) (matrixUnitBasis n B) f\n have hX : e (e.symm X) = X := e.apply_symm_apply X\n have hf : Matrix.toLinAlgEquiv (matrixUnitBasis n B) X = f := by\n exact (Matrix.toLinAlgEquiv (matrixUnitBasis n B)).apply_symm_apply f\n have hmem : e.symm X \u2208 (definingHopfIdeal n R).lieSubalgebra (B := B) \u2194\n \u2200 x y, f (x * y) = f x * y + x * f y := by\n rw [ConstantMultiplication.mem_lieSubalgebra_definingHopfIdeal_iff]\n rw [\u2190 GeneralLinear.tangentLieEquivMatrix_apply, hX]\n exact ConstantMultiplication.toMatrix_leibniz_iff (R := R)\n (structureMatrix n R) (matrixUnitBasis n B)\n (toMatrix_mulLeft_matrixUnitBasis n B R) f\n rw [\u2190 hmem]\n constructor\n \u00b7 rintro \u27e8d, hd\u27e9\n have hmatrix : e (HopfIdeal.quotientLieHom (definingHopfIdeal n R) d) = X := by\n apply (Matrix.toLinAlgEquiv (matrixUnitBasis n B)).injective\n rw [hf]\n exact hd\n rw [\u2190 hmatrix, e.symm_apply_apply]\n rw [\u2190 HopfIdeal.quotientLieEquiv_apply_coe]\n exact ((definingHopfIdeal n R).quotientLieEquiv d).property\n \u00b7 intro hd\n let q := (definingHopfIdeal n R).quotientLieEquiv (B := B)\n let d := q.symm \u27e8e.symm X, hd\u27e9\n have hqd := congrArg Subtype.val (q.apply_symm_apply \u27e8e.symm X, hd\u27e9)\n rw [HopfIdeal.quotientLieEquiv_apply_coe] at hqd\n refine \u27e8d, ?_\u27e9\n rw [tangentEnd_apply, \u2190 GeneralLinear.tangentLieEquivMatrix_apply, hqd, hX, hf]", "proof_lines": 29, "proof_length": 1367, "rev": "75c8aed5fea63047615a25a9763fd5b68a86e891", "heartbeats": 2612, "image": "lean-compression:tauceti-75c8aed5fe-a608030cfc", "split": "dev"} {"path": "TauCeti/LinearAlgebra/QuadraticForm/CartanDieudonne/CharTwo.lean", "module": "TauCeti.LinearAlgebra.QuadraticForm.CartanDieudonne.CharTwo", "theorem": "TauCeti.QuadraticMap.subgroup_eq_top_of_reflection_mem_of_nondegenerate_polarBilin", "prefix": "/-\nCopyright (c) 2026 The Tau Ceti contributors. All rights reserved.\nReleased under Apache 2.0 license as described in the file LICENSE.\nAuthors: The Tau Ceti contributors\n-/\nmodule\n\npublic import TauCeti.LinearAlgebra.QuadraticForm.CharTwo\npublic import TauCeti.LinearAlgebra.QuadraticForm.OrthogonalGroup.Basic\nimport TauCeti.Algebra.CharP.Two\nimport TauCeti.Algebra.GroupWithZero.Units.Basic\nimport TauCeti.LinearAlgebra.BilinearForm.Orthogonal\nimport TauCeti.LinearAlgebra.BilinearForm.SymplecticBasis\nimport TauCeti.LinearAlgebra.QuadraticForm.CartanDieudonne.Basic\nimport TauCeti.LinearAlgebra.QuadraticForm.OrthogonalGroup.Restrict\nimport TauCeti.LinearAlgebra.QuadraticForm.TotallyIsotropic\n\n/-!\n# Dieudonn\u00e9's theorem: orthogonal transvections in characteristic two\n\nOver a field of characteristic two, the reflection `reflectionOrthogonal Q v` in a vector `v` of\nnonzero norm is the orthogonal transvection `x \u21a6 x + (polar Q v x / Q v) \u2022 v`: it fixes `v` and the\npolar orthogonal hyperplane of `v`, which contains `v`. For a quadratic form whose polar form is\nnondegenerate, these transvections generate the orthogonal group, the one exception being the\northogonal sum of two hyperbolic planes over the field with two elements. Together with the\nCartan--Dieudonn\u00e9 theorem in characteristic different from two this gives generation by reflections\nover every field. In characteristic two the theorem applies to the quadratic space `M / 2 M` of an\neven unimodular lattice `M`, whose polar form is nondegenerate: if `M / 2 M` is not the exceptional\nspace and every class of norm one contains a root of `M`, then reflections in roots induce every\nisometry of `M / 2 M`. This is a step in describing the image of `O(M(2))` in the orthogonal group\nof its discriminant form.\n\n## Implementation notes\n\nThe proof is by induction on the dimension. Fix a frame `(e, f)` with `Q e \u2260 0` and\n`polar Q e f = 1`. Outside the exceptional case the transvections act transitively on the vectors\nof norm `Q e`, and those fixing `e` act transitively on the vectors `f'` of norm `Q f` with\n`polar Q e f' = 1`. So after composing with transvections an orthogonal map fixes `e` and `f`, and\nit is generated by transvections of the polar orthogonal complement of the plane they span. Over\nthe field with two elements in dimension six this complement may be the exceptional space; the\nframe is then changed so that its complement is an anisotropic plane plus a hyperbolic plane.\n\n## Main results\n\n* `TauCeti.QuadraticMap.subgroup_eq_top_of_reflection_mem_of_nondegenerate_polarBilin`: a subgroup\n of the orthogonal group containing every reflection in a vector of invertible norm is the whole\n orthogonal group, for a nondegenerate polar form other than two hyperbolic planes over a field\n with two elements.\n\n## References\n\n* J. Dieudonn\u00e9, *Sur les groupes classiques*, Actualit\u00e9s Sci. Ind. 1040, Hermann (1948).\n* A. Hunnell, J. Hutchens and N. Schwartz, *On involutions of type O(q,k) over a field of\n characteristic two*, arXiv:1903.09904v3, \u00a73.\n-/\n\npublic section\n\nopen QuadraticMap Module\n\nnamespace TauCeti.QuadraticMap\n\nuniverse u v\n\nvariable {K : Type u} {V : Type v} [Field K] [AddCommGroup V] [Module K V]\n\nsection Transvection\n\nvariable [CharP K 2] (Q : QuadraticForm K V)\n\nprivate theorem map_add_ne_zero_of_polar_ne_zero {x y : V} (hxy : Q x = Q y)\n (hp : polar Q x y \u2260 0) : Q (x + y) \u2260 0 := by\n rwa [map_add_eq_polar_of_map_eq Q hxy]\n\n/-- The transvection in `x + y` sends `x` to `y` when `x` and `y` have equal norm and nonzero\npolar pairing: in characteristic two, `x + y = x - y`, so this is\n`reflection_sub_apply_eq_of_map_eq`. -/\nprivate theorem reflectionOrthogonalOfNeZero_add_apply_left {x y : V} (hxy : Q x = Q y)\n (hp : polar Q x y \u2260 0) :\n (reflectionOrthogonalOfNeZero Q (x + y) (map_add_ne_zero_of_polar_ne_zero Q hxy hp) :\n V \u2243\u2097[K] V) x = y := by\n have key (a : V) (ha : Q a \u2260 0) (h : a = x - y) :\n (reflectionOrthogonalOfNeZero Q a ha : V \u2243\u2097[K] V) x = y := by\n subst h\n let _ := invertibleOfNonzero ha\n rw [reflectionOrthogonalOfNeZero_eq, coe_reflectionOrthogonal]\n exact reflection_sub_apply_eq_of_map_eq Q x y hxy\n exact key _ _ (by\n rw [sub_eq_add_neg, neg_eq_of_add_eq_zero_left (add_self_eq_zero_of_charTwo K y)])\n\nvariable {Q} (H : Subgroup (orthogonalGroup Q))\n\n/-- Vectors of equal norm and nonzero polar pairing are exchanged by a transvection. -/\nprivate theorem exists_mem_apply_eq_of_polar_ne_zero\n (hH : \u2200 a ha, reflectionOrthogonalOfNeZero Q a ha \u2208 H) {x y : V}\n (hxy : Q x = Q y) (hp : polar Q x y \u2260 0) :\n \u2203 h \u2208 H, (h : V \u2243\u2097[K] V) x = y \u2227\n \u2200 z, polar Q x z = polar Q y z \u2192 (h : V \u2243\u2097[K] V) z = z :=\n \u27e8_, hH _ _, reflectionOrthogonalOfNeZero_add_apply_left Q hxy hp, fun z hz \u21a6\n reflectionOrthogonalOfNeZero_apply_of_polar_eq_zero Q _ _\n (by rw [polar_add_left, hz, CharTwo.add_self_eq_zero])\u27e9\n\n/-- **The stabilizer step.** If `Q e \u2260 0`, the transvections fixing `e` act transitively on the\nvectors `f` of a given norm with `polar Q e f = 1`. -/\nprivate theorem exists_mem_fix_apply_eq (hH : \u2200 a ha, reflectionOrthogonalOfNeZero Q a ha \u2208 H)\n {e f f' : V} (he : Q e \u2260 0) (hf : polar Q e f = 1) (hf' : polar Q e f' = 1) (hff : Q f' = Q f) :\n \u2203 h \u2208 H, (h : V \u2243\u2097[K] V) e = e \u2227 (h : V \u2243\u2097[K] V) f' = f := by\n have hfe : polar Q f e = 1 := by rw [polar_comm, hf]\n have hf'e : polar Q f' e = 1 := by rw [polar_comm, hf']\n by_cases hp : polar Q f' f = 0\n \u00b7 set z := f + (Q e)\u207b\u00b9 \u2022 e with hz\n have hQz : Q z = Q f := by\n have h : (Q e)\u207b\u00b9 * (Q e)\u207b\u00b9 * Q e = (Q e)\u207b\u00b9 := by field_simp\n simp only [hz, QuadraticMap.map_add (\u21d1Q), QuadraticMap.map_smul, polar_smul_right, hfe,\n smul_eq_mul, h, mul_one, add_assoc, CharTwo.add_self_eq_zero, add_zero]\n have hze : polar Q z e = 1 := by\n simp only [hz, polar_add_left, polar_smul_left, polar_self_eq_zero_of_charTwo, smul_zero,\n add_zero, hfe]\n have hzf : polar Q z f = (Q e)\u207b\u00b9 := by\n simp only [hz, polar_add_left, polar_smul_left, polar_self_eq_zero_of_charTwo, hf,\n smul_eq_mul, mul_one, zero_add]\n have hf'z : polar Q f' z = (Q e)\u207b\u00b9 := by\n simp only [hz, polar_add_right, polar_smul_right, hp, hf'e, smul_eq_mul, mul_one, zero_add]\n have hinv : (Q e)\u207b\u00b9 \u2260 0 := inv_ne_zero he\n obtain \u27e8h\u2081, hh\u2081, hh\u2081f', hh\u2081e\u27e9 :=\n exists_mem_apply_eq_of_polar_ne_zero H hH (hff.trans hQz.symm) (hf'z \u25b8 hinv)\n obtain \u27e8h\u2082, hh\u2082, hh\u2082z, hh\u2082e\u27e9 :=\n exists_mem_apply_eq_of_polar_ne_zero H hH hQz (hzf \u25b8 hinv)\n refine \u27e8h\u2082 * h\u2081, H.mul_mem hh\u2082 hh\u2081, ?_, ?_\u27e9\n \u00b7 rw [orthogonalGroup.coe_mul_apply, hh\u2081e e (by rw [hf'e, hze]), hh\u2082e e (by rw [hze, hfe])]\n \u00b7 rw [orthogonalGroup.coe_mul_apply, hh\u2081f', hh\u2082z]\n \u00b7 obtain \u27e8h, hh, hhf', hhe\u27e9 := exists_mem_apply_eq_of_polar_ne_zero H hH hff hp\n exact \u27e8h, hh, hhe e (by rw [hf'e, hfe]), hhf'\u27e9\n\n/-- Two vectors of equal nonzero norm are related by a product of at most two transvections, as\nlong as every pair of such vectors that are polar orthogonal admits a vector of nonzero norm with\nnonzero polar pairing with both. -/\nprivate theorem exists_mem_apply_eq (hH : \u2200 a ha, reflectionOrthogonalOfNeZero Q a ha \u2208 H)\n (hgood : \u2200 x y : V, Q x = Q y \u2192 Q x \u2260 0 \u2192 polar Q x y = 0 \u2192 x \u2260 y \u2192\n \u2203 w, Q w \u2260 0 \u2227 polar Q x w \u2260 0 \u2227 polar Q y w \u2260 0)\n {x y : V} (hxy : Q x = Q y) (hx : Q x \u2260 0) : \u2203 h \u2208 H, (h : V \u2243\u2097[K] V) x = y := by\n by_cases hxy' : x = y\n \u00b7 exact \u27e81, H.one_mem, by rw [hxy', Subgroup.coe_one, one_apply_eq_self]\u27e9\n by_cases hp : polar Q x y = 0\n \u00b7 obtain \u27e8w, hw, hxw, hyw\u27e9 := hgood x y hxy hx hp hxy'\n set c := (Q w)\u207b\u00b9 * polar Q w x\n have hc0 : c \u2260 0 := mul_ne_zero (inv_ne_zero hw) (by rwa [polar_comm])\n have hz : (reflectionOrthogonalOfNeZero Q w hw : V \u2243\u2097[K] V) x = x + c \u2022 w := by\n rw [reflectionOrthogonalOfNeZero_apply, sub_eq_add_neg, \u2190 neg_smul, CharTwo.neg_eq]\n set z := (reflectionOrthogonalOfNeZero Q w hw : V \u2243\u2097[K] V) x\n have hQz : Q x = Q z :=\n (map_app_of_mem_orthogonalGroup (reflectionOrthogonalOfNeZero Q w hw).property x).symm\n have hxz : polar Q x z \u2260 0 := by\n simp only [hz, polar_add_right, polar_smul_right, polar_self_eq_zero_of_charTwo, zero_add,\n smul_eq_mul]\n exact mul_ne_zero hc0 hxw\n have hzy : polar Q z y \u2260 0 := by\n simp only [hz, polar_add_left, polar_smul_left, hp, zero_add, smul_eq_mul,\n polar_comm (\u21d1Q) w y]\n exact mul_ne_zero hc0 hyw\n obtain \u27e8h\u2081, hh\u2081, hh\u2081x, -\u27e9 := exists_mem_apply_eq_of_polar_ne_zero H hH hQz hxz\n obtain \u27e8h\u2082, hh\u2082, hh\u2082z, -\u27e9 :=\n exists_mem_apply_eq_of_polar_ne_zero H hH (hQz.symm.trans hxy) hzy\n exact \u27e8h\u2082 * h\u2081, H.mul_mem hh\u2082 hh\u2081, by rw [orthogonalGroup.coe_mul_apply, hh\u2081x, hh\u2082z]\u27e9\n \u00b7 obtain \u27e8h, hh, hhx, -\u27e9 := exists_mem_apply_eq_of_polar_ne_zero H hH hxy hp\n exact \u27e8h, hh, hhx\u27e9\n\nend Transvection\n\nsection Nondegenerate\n\nvariable {Q : QuadraticForm K V}\n\n/-- A nonzero nondegenerate quadratic space has a vector `e` of nonzero norm and a vector `f`\nwith `polar Q e f = 1`. -/\nprivate theorem exists_frame [CharP K 2] [Nontrivial V] (hB : Q.polarBilin.Nondegenerate) :\n \u2203 e f : V, Q e \u2260 0 \u2227 polar Q e f = 1 := by\n obtain \u27e8x, hx\u27e9 := exists_ne (0 : V)\n obtain \u27e8u, hu\u27e9 := LinearMap.BilinForm.Nondegenerate.exists_apply_ne_zero hB hx\n rw [polarBilin_apply_apply] at hu\n set y := (polar Q x u)\u207b\u00b9 \u2022 u\n have hxy : polar Q x y = 1 := by rw [polar_smul_right, smul_eq_mul, inv_mul_cancel\u2080 hu]\n by_cases hQx : Q x = 0\n \u00b7 by_cases hQy : Q y = 0\n \u00b7 refine \u27e8x + y, y, by rw [QuadraticMap.map_add (\u21d1Q), hQx, hQy, hxy]; simp, ?_\u27e9\n rw [polar_add_left, hxy, polar_self_eq_zero_of_charTwo, add_zero]\n \u00b7 exact \u27e8y, x, hQy, by rw [polar_comm, hxy]\u27e9\n \u00b7 exact \u27e8x, y, hQx, hxy\u27e9\n\n/-- The exceptional quadratic spaces: the orthogonal sums of two hyperbolic planes over a field of\ntwo elements, in the form of four-dimensional spaces with a two-dimensional totally isotropic\nsubspace. -/\nprivate def Exc (Q : QuadraticForm K V) : Prop :=\n Nat.card K = 2 \u2227 finrank K V = 4 \u2227\n \u2203 U : Submodule K V, Q.IsTotallyIsotropic U \u2227 finrank K U = 2\n\n/-- If every `f + c \u2022 x` is singular, where `Q x \u2260 0` and `polar Q f x \u2260 0`, then the field has\ntwo elements: the quadratic polynomial `c \u21a6 Q (f + c \u2022 x)` has at most two roots. -/\nprivate theorem eq_zero_or_eq_one_of_forall_map_add_smul_eq_zero [CharP K 2] {x f : V}\n (hx : Q x \u2260 0) (hfx : polar Q f x \u2260 0) (hcand : \u2200 c : K, Q (f + c \u2022 x) = 0) (d : K) :\n d = 0 \u2228 d = 1 := by\n have hQf : Q f = 0 := by simpa using hcand 0\n by_contra! hd\n set c := d * polar Q f x / Q x with hc\n have hc0 : c \u2260 0 := div_ne_zero (mul_ne_zero hd.1 hfx) hx\n have h := hcand c\n rw [QuadraticMap.map_add (\u21d1Q), QuadraticMap.map_smul, polar_smul_right, hQf, zero_add,\n smul_eq_mul, smul_eq_mul] at h\n have h2 : c * Q x + polar Q f x = 0 :=\n (mul_eq_zero.mp (by linear_combination h)).resolve_left hc0\n have h3 : (d + 1) * polar Q f x = 0 := by\n rw [\u2190 h2, hc]; field_simp\n exact hd.2 (by\n have := (mul_eq_zero.mp h3).resolve_right hfx\n rwa [CharTwo.add_eq_zero] at this)\n\n/-- If `f + u` is singular for every `u` polar orthogonal to `x` and `y`, then the polar orthogonal\ncomplement of `x` and `y` is polar-isotropic, so the dimension is at most four. -/\nprivate theorem finrank_le_four_of_map_add_eq_zero [CharP K 2] [FiniteDimensional K V]\n (hB : Q.polarBilin.Nondegenerate) {x y f : V}\n (hf : \u2200 u, polar Q x u = 0 \u2192 polar Q y u = 0 \u2192 Q (f + u) = 0) : finrank K V \u2264 4 := by\n classical\n set U := LinearMap.BilinForm.orthogonal Q.polarBilin (Submodule.span K {x, y})\n have hQf : Q f = 0 := by\n simpa using hf 0 (polar_zero_right (Q := Q) x) (polar_zero_right (Q := Q) y)\n have hQU {u : V} (hu : u \u2208 U) : Q u = polar Q f u := by\n obtain \u27e8hxu, hyu\u27e9 := LinearMap.BilinForm.mem_orthogonal_span_pair_iff.mp hu\n rw [polarBilin_apply_apply] at hxu hyu\n have h := hf u hxu hyu\n rw [QuadraticMap.map_add (\u21d1Q), hQf, zero_add, CharTwo.add_eq_zero] at h\n exact h\n have hUiso : U \u2264 LinearMap.BilinForm.orthogonal Q.polarBilin U := by\n intro u hu\n rw [LinearMap.BilinForm.mem_orthogonal_iff]\n intro u' hu'\n rw [polarBilin_apply_apply, polar, hQU (U.add_mem hu' hu), hQU hu', hQU hu, polar_add_right]\n ring\n have hUdim := LinearMap.BilinForm.two_mul_finrank_le_finrank_of_le_orthogonal hB hUiso\n have hspan : finrank K (Submodule.span K {x, y}) \u2264 2 := by\n have := finrank_span_finset_le_card (R := K) ({x, y} : Finset V)\n rw [Set.finrank, Finset.coe_pair] at this\n exact this.trans Finset.card_le_two\n have hUfin : finrank K U = finrank K V - finrank K (Submodule.span K {x, y}) :=\n LinearMap.BilinForm.finrank_orthogonal hB _\n omega\n\n/-- For distinct polar-orthogonal `x` and `y` of equal norm and a singular `f` pairing equally with\nthem and nontrivially with `x`, the vectors `f` and `x + y` span a totally isotropic plane. -/\nprivate theorem exists_isTotallyIsotropic_finrank_eq_two [CharP K 2] {x y f : V}\n (hxy : Q x = Q y) (hp : polar Q x y = 0) (hne : x \u2260 y) (hQf : Q f = 0)\n (hxf : polar Q x f \u2260 0) (hfxy : polar Q f x = polar Q f y) :\n \u2203 S : Submodule K V, Q.IsTotallyIsotropic S \u2227 finrank K S = 2 := by\n have hpxy : polar Q f (x + y) = 0 := by\n rw [polar_add_right, hfxy, CharTwo.add_self_eq_zero]\n have hQxy : Q (x + y) = 0 := by\n rw [map_add_eq_polar_of_map_eq Q hxy, hp]\n have hxy0 : x + y \u2260 0 := fun h \u21a6\n hne ((add_eq_zero_iff_eq_of_charTwo K).mp h)\n have hli : LinearIndependent K ![f, x + y] := by\n rw [LinearIndependent.pair_iff]\n intro a b hab\n have h1 := congrArg (polar Q x) hab\n simp only [polar_add_right, polar_smul_right, polar_self_eq_zero_of_charTwo, hp, add_zero,\n mul_zero, polar_zero_right, smul_eq_mul] at h1\n have ha : a = 0 := (mul_eq_zero.mp h1).resolve_right hxf\n refine \u27e8ha, ?_\u27e9\n rw [ha, zero_smul, zero_add] at hab\n exact (smul_eq_zero.mp hab).resolve_right hxy0\n refine \u27e8Submodule.span K {f, x + y}, isTotallyIsotropic_iff.mpr fun v hv \u21a6 ?_, ?_\u27e9\n \u00b7 obtain \u27e8a, b, rfl\u27e9 := Submodule.mem_span_pair.mp hv\n rw [QuadraticMap.map_add (\u21d1Q), QuadraticMap.map_smul, QuadraticMap.map_smul, polar_smul_left,\n polar_smul_right, hQf, hQxy, hpxy]\n simp\n \u00b7 rw [show ({f, x + y} : Set V) = Set.range ![f, x + y] by simp [Set.pair_comm],\n finrank_span_eq_card hli, Fintype.card_fin]\n\n/-- Outside the exceptional case, two distinct polar-orthogonal vectors `x` and `y` of equal\nnonzero norm admit a vector of nonzero norm with nonzero polar pairing with both. If there were\nnone, then for `f` pairing nontrivially with `x` and `y`, every `f + c \u2022 x` and every `f + u` with\n`u` polar orthogonal to `x` and `y` would be singular; so the field has two elements, the dimension\nis at most four, and `f` and `x + y` span a totally isotropic plane. -/\nprivate theorem exists_good [CharP K 2] [FiniteDimensional K V]\n (hB : Q.polarBilin.Nondegenerate) (hexc : \u00ac Exc Q) {x y : V} (hxy : Q x = Q y)\n (hx : Q x \u2260 0) (hp : polar Q x y = 0) (hne : x \u2260 y) :\n \u2203 w, Q w \u2260 0 \u2227 polar Q x w \u2260 0 \u2227 polar Q y w \u2260 0 := by\n have hx0 : x \u2260 0 := fun h \u21a6 hx (by rw [h, map_zero])\n have hy0 : y \u2260 0 := fun h \u21a6 hx (by rw [hxy, h, map_zero])\n obtain \u27e8f, hxf, hyf\u27e9 :=\n LinearMap.BilinForm.Nondegenerate.exists_apply_ne_zero_and_apply_ne_zero hB hx0 hy0\n rw [polarBilin_apply_apply] at hxf hyf\n by_contra! hno\n have hfx : polar Q f x \u2260 0 := by rwa [polar_comm]\n have hfy : polar Q f y \u2260 0 := by rwa [polar_comm]\n have hcand (c : K) : Q (f + c \u2022 x) = 0 := by\n by_contra hc\n have h := hno _ hc (by\n rwa [polar_add_right, polar_smul_right, polar_self_eq_zero_of_charTwo, smul_zero, add_zero])\n rw [polar_add_right, polar_smul_right, polar_comm _ y x, hp, smul_zero, add_zero] at h\n exact hyf h\n have hK := eq_zero_or_eq_one_of_forall_map_add_smul_eq_zero hx hfx hcand\n have hdim : finrank K V \u2264 4 := by\n refine finrank_le_four_of_map_add_eq_zero hB (x := x) (y := y) (f := f) fun u hxu hyu \u21a6 ?_\n by_contra hfu\n have h := hno _ hfu (by rwa [polar_add_right, hxu, add_zero])\n rw [polar_add_right, hyu, add_zero] at h\n exact hyf h\n obtain \u27e8S, hS, hS2\u27e9 := exists_isTotallyIsotropic_finrank_eq_two hxy hp hne\n (by simpa using hcand 0) hxf (by rw [(hK _).resolve_left hfx, (hK _).resolve_left hfy])\n have hSle := hS.two_mul_finrank_le_finrank\n (eq_bot_mono Q.radical_le_ker_polarBilin (LinearMap.BilinForm.Nondegenerate.ker_eq_bot hB))\n exact hexc \u27e8natCard_eq_two_iff_forall_eq_zero_or_eq_one.mpr hK, by omega, S, hS, hS2\u27e9\n\nomit [AddCommGroup V] [Module K V] in\nprivate theorem polarBilin_apply_eq_one_of_polar_eq_one {M : Type*} [AddCommGroup M] [Module K M]\n {Q : QuadraticForm K M} {e f : M} (hef : polar Q e f = 1) : Q.polarBilin f e = 1 := by\n rw [polarBilin_apply_apply, polar_comm, hef]\n\nend Nondegenerate\n\nsection Restriction\n\nvariable [CharP K 2] {Q : QuadraticForm K V}\n\nomit [CharP K 2] in\n/-- The orthogonal maps of the restriction of `Q` to `W` that extend to an element of `H` fixing\n`P` pointwise. -/\nprivate def extensionSubgroup (H : Subgroup (orthogonalGroup Q)) (W P : Submodule K V) :\n Subgroup (orthogonalGroup (Q.restrict W)) where\n carrier := {k | \u2203 g \u2208 H, (\u2200 u : W, (g : V \u2243\u2097[K] V) u = ((k : W \u2243\u2097[K] W) u : V)) \u2227\n \u2200 z \u2208 P, (g : V \u2243\u2097[K] V) z = z}\n mul_mem' := by\n rintro k\u2081 k\u2082 \u27e8g\u2081, hg\u2081, hg\u2081W, hg\u2081P\u27e9 \u27e8g\u2082, hg\u2082, hg\u2082W, hg\u2082P\u27e9\n refine \u27e8g\u2081 * g\u2082, H.mul_mem hg\u2081 hg\u2082, fun u \u21a6 ?_, fun z hz \u21a6 ?_\u27e9\n \u00b7 rw [orthogonalGroup.coe_mul_apply, hg\u2082W, hg\u2081W, orthogonalGroup.coe_mul_apply]\n \u00b7 rw [orthogonalGroup.coe_mul_apply, hg\u2082P z hz, hg\u2081P z hz]\n one_mem' := \u27e81, H.one_mem, fun _ \u21a6 by simp only [Subgroup.coe_one, one_apply_eq_self],\n fun _ _ \u21a6 by rw [Subgroup.coe_one, one_apply_eq_self]\u27e9\n inv_mem' := by\n rintro k \u27e8g, hg, hgW, hgP\u27e9\n refine \u27e8g\u207b\u00b9, H.inv_mem hg, fun u \u21a6 orthogonalGroup.inv_apply_eq_of_apply_eq ?_, fun z hz \u21a6\n orthogonalGroup.inv_apply_eq_of_apply_eq (hgP z hz)\u27e9\n rw [hgW, \u2190 orthogonalGroup.coe_mul_apply, mul_inv_cancel, Subgroup.coe_one, one_apply_eq_self]\n\nomit [CharP K 2] in\n/-- The transvections of the restriction of `Q` to `W` extend to transvections of `Q` fixing every\nvector polar orthogonal to `W`. -/\nprivate theorem reflectionOrthogonalOfNeZero_mem_extensionSubgroup\n {H : Subgroup (orthogonalGroup Q)} (hH : \u2200 a ha, reflectionOrthogonalOfNeZero Q a ha \u2208 H)\n {W P : Submodule K V} (hWP : W \u2264 LinearMap.BilinForm.orthogonal Q.polarBilin P) (a : W)\n (ha : (Q.restrict W) a \u2260 0) :\n reflectionOrthogonalOfNeZero (Q.restrict W) a ha \u2208 extensionSubgroup H W P := by\n have ha' : Q a \u2260 0 := by simpa only [QuadraticMap.restrict_apply] using ha\n refine \u27e8reflectionOrthogonalOfNeZero Q a ha', hH a ha',\n reflectionOrthogonalOfNeZero_restrict_apply Q W a ha, fun z hz \u21a6 ?_\u27e9\n refine reflectionOrthogonalOfNeZero_apply_of_polar_eq_zero Q a ha' ?_\n rw [polar_comm]\n exact (LinearMap.BilinForm.mem_orthogonal_iff.mp (hWP a.property)) z hz\n\n/-- **The restriction step.** If the transvections generate the orthogonal group of the polar\northogonal complement `W` of a plane spanned by `e` and `f` with `polar Q e f = 1`, then every\northogonal map fixing `e` and `f` lies in every subgroup containing the transvections. -/\nprivate theorem mem_of_apply_eq_self {e f : V} (hef : polar Q e f = 1)\n (ih : \u2200 H' : Subgroup (orthogonalGroup (Q.restrict\n (LinearMap.BilinForm.orthogonal Q.polarBilin (Submodule.span K {e, f})))),\n (\u2200 a ha, reflectionOrthogonalOfNeZero _ a ha \u2208 H') \u2192 H' = \u22a4)\n (H : Subgroup (orthogonalGroup Q)) (hH : \u2200 a ha, reflectionOrthogonalOfNeZero Q a ha \u2208 H)\n (g : orthogonalGroup Q) (hge : (g : V \u2243\u2097[K] V) e = e) (hgf : (g : V \u2243\u2097[K] V) f = f) :\n g \u2208 H := by\n set P := Submodule.span K {e, f}\n set W := LinearMap.BilinForm.orthogonal Q.polarBilin P\n obtain \u27e8g', hg', hg'W, hg'P\u27e9 :\n orthogonalGroup.restrict g (map_orthogonal_polarBilin_of_mem_orthogonalGroup g.property\n (by rw [Submodule.map_span, Set.image_pair, LinearEquiv.coe_coe, hge, hgf])) \u2208\n extensionSubgroup H W P := by\n rw [ih _ (reflectionOrthogonalOfNeZero_mem_extensionSubgroup hH le_rfl)]\n exact Subgroup.mem_top _\n convert hg'\n refine Subtype.ext (LinearEquiv.toLinearMap_injective (LinearMap.ext_on_codisjoint\n (LinearMap.BilinForm.IsAlt.isCompl_span_pair_orthogonal Q.isAlt_polarBilin\n (polarBilin_apply_eq_one_of_polar_eq_one hef)).symm.codisjoint\n (fun w hw \u21a6 ?_) (fun z hz \u21a6 ?_)))\n \u00b7 simp only [LinearEquiv.coe_coe]\n rw [hg'W \u27e8w, hw\u27e9, orthogonalGroup.coe_restrict_apply]\n \u00b7 obtain \u27e8a, b, rfl\u27e9 := Submodule.mem_span_pair.mp hz\n simp only [LinearEquiv.coe_coe]\n rw [hg'P _ hz, map_add, map_smul, map_smul, hge, hgf]\n\nend Restriction\n\nsection Induction\n\nvariable [CharP K 2]\n\nomit [AddCommGroup V] [Module K V] in\n/-- Over the field with two elements, the binary form `(p + q)\u00b2 + q p` is anisotropic. -/\nprivate theorem eq_zero_and_eq_zero_of_natCard_eq_two (hcard : Nat.card K = 2) {p q : K}\n (h : (p + q) * (p + q) + q * p = 0) : p = 0 \u2227 q = 0 := by\n have hK := natCard_eq_two_iff_forall_eq_zero_or_eq_one.mp hcard\n have h11 : (1 : K) + 1 = 0 := CharTwo.add_self_eq_zero 1\n rcases hK p with rfl | rfl <;> rcases hK q with rfl | rfl\n \u00b7 exact \u27e8rfl, rfl\u27e9\n \u00b7 simp at h\n \u00b7 simp at h\n \u00b7 rw [h11] at h\n simp at h\n\n/-- A singular member `v i\u2080` of a linearly independent family, polar orthogonal to the whole\nfamily, has a singular partner pairing to one with `v i\u2080` and to zero with the rest. -/\nprivate theorem exists_hyperbolic_partner [FiniteDimensional K V]\n {Q : QuadraticForm K V} (hB : Q.polarBilin.Nondegenerate) {\u03b9 : Type*} [Finite \u03b9]\n [DecidableEq \u03b9] {v : \u03b9 \u2192 V} (hv : LinearIndependent K v) (i\u2080 : \u03b9) (hQ : Q (v i\u2080) = 0)\n (hp : \u2200 j, polar Q (v j) (v i\u2080) = 0) :\n \u2203 w, Q w = 0 \u2227 \u2200 j, polar Q (v j) w = if j = i\u2080 then 1 else 0 := by\n obtain \u27e8t, ht\u27e9 := LinearMap.BilinForm.Nondegenerate.exists_forall_apply_eq hB hv\n fun j \u21a6 if j = i\u2080 then 1 else 0\n simp only [polarBilin_apply_apply] at ht\n refine \u27e8t + Q t \u2022 v i\u2080, ?_, fun j \u21a6 ?_\u27e9\n \u00b7 have h : polar Q t (v i\u2080) = 1 := by simpa using ht i\u2080\n rw [QuadraticMap.map_add (\u21d1Q), QuadraticMap.map_smul, hQ, polar_smul_right, h]\n simp [CharTwo.add_self_eq_zero]\n \u00b7 rw [polar_add_right, polar_smul_right, hp j, smul_zero, add_zero, polar_comm, ht j]\n\nomit [CharP K 2] in\n/-- Expansion in a symplectic family `x i, y i` spanning the space. -/\nprivate theorem eq_sum_polar_smul_add_polar_smul [FiniteDimensional K V]\n {Q : QuadraticForm K V} (hB : Q.polarBilin.Nondegenerate) {m : \u2115} {x y : Fin m \u2192 V}\n (hxy : \u2200 i j, polar Q (x i) (y j) = if i = j then 1 else 0)\n (hxx : \u2200 i j, polar Q (x i) (x j) = 0) (hyy : \u2200 i j, polar Q (y i) (y j) = 0)\n (hn : finrank K V = 2 * m) (u : V) :\n u = \u2211 i, (polar Q u (y i) \u2022 x i + polar Q u (x i) \u2022 y i) := by\n have h := LinearMap.BilinForm.Nondegenerate.eq_sum_apply_smul hB (v := Sum.elim x y)\n (w := Sum.elim y x) (fun a b \u21a6 by\n rw [polarBilin_apply_apply]\n rcases a with i | i <;> rcases b with j | j\n \u00b7 simp [hxy]\n \u00b7 simp [hxx]\n \u00b7 simp [hyy]\n \u00b7 rw [Sum.elim_inr, Sum.elim_inr, polar_comm, hxy]\n simp [eq_comm])\n (by simp [hn, two_mul]) u\n simp only [polarBilin_apply_apply] at h\n rwa [Fintype.sum_sum_type, \u2190 Finset.sum_add_distrib] at h\n\nomit [CharP K 2] in\n/-- A subspace `W` is not exceptional if each of its singular vectors `u` whose pairings with a\nhyperbolic pair `h, h'` have vanishing product is `polar Q u h' \u2022 h + polar Q u h \u2022 h'`. Indeed, a\ntotally isotropic plane `U \u2264 W` would then map isomorphically onto `K \u00d7 K` by these two pairings,\nso it would contain `h` and `h'`, which pair to one. -/\nprivate theorem not_exc_of_eq_smul_add_smul [FiniteDimensional K V] {Q : QuadraticForm K V}\n {W : Submodule K V}\n {h h' : V} (hh : polar Q h h' = 1)\n (hkey : \u2200 u \u2208 W, Q u = 0 \u2192 polar Q u h' * polar Q u h = 0 \u2192\n u = polar Q u h' \u2022 h + polar Q u h \u2022 h') :\n \u00ac Exc (Q.restrict W) := by\n rintro \u27e8-, -, U', hU', hU'2\u27e9\n set U := U'.map W.subtype\n have hU : Q.IsTotallyIsotropic U := isTotallyIsotropic_restrict_iff.mp hU'\n have hU2 : finrank K U = 2 := by rw [Submodule.finrank_map_subtype_eq, hU'2]\n have hkey' (u : U) (hu : polar Q u h' * polar Q u h = 0) :\n (u : V) = polar Q u h' \u2022 h + polar Q u h \u2022 h' :=\n hkey u (Submodule.map_subtype_le W U' u.property) (hU.apply_eq_zero u.property) hu\n let L : U \u2192\u2097[K] K \u00d7 K := LinearMap.prod ((Q.polarBilin.flip h').comp U.subtype)\n ((Q.polarBilin.flip h).comp U.subtype)\n have hL (u : U) : L u = (polar Q u h', polar Q u h) := by\n simp [L, polarBilin_apply_apply]\n have hinj : Function.Injective L := by\n rw [\u2190 LinearMap.ker_eq_bot, Submodule.eq_bot_iff]\n intro u hu\n rw [LinearMap.mem_ker, hL, Prod.mk_eq_zero] at hu\n have := hkey' u (by rw [hu.1, zero_mul])\n rw [hu.1, hu.2, zero_smul, zero_smul, add_zero] at this\n exact Subtype.ext this\n have hsurj := (LinearMap.injective_iff_surjective_of_finrank_eq_finrank\n (by simp [hU2])).mp hinj\n obtain \u27e8u\u2081, hu\u2081\u27e9 := hsurj (1, 0)\n obtain \u27e8u\u2082, hu\u2082\u27e9 := hsurj (0, 1)\n rw [hL, Prod.mk.injEq] at hu\u2081 hu\u2082\n have h\u2081 := hkey' u\u2081 (by rw [hu\u2081.2, mul_zero])\n have h\u2082 := hkey' u\u2082 (by rw [hu\u2082.1, zero_mul])\n rw [hu\u2081.1, hu\u2081.2, one_smul, zero_smul, add_zero] at h\u2081\n rw [hu\u2082.1, hu\u2082.2, one_smul, zero_smul, zero_add] at h\u2082\n have h0 := hU.polar_eq_zero u\u2081.property u\u2082.property\n rw [h\u2081, h\u2082, hh] at h0\n exact one_ne_zero h0\n\n/-- In a six-dimensional space over the field with two elements with a symplectic basis\n`x 0, x 1, x 2, y 0, y 1, y 2` in which `Q (x 0) = 1` and `x 1, x 2, y 1, y 2` are singular, the\npolar orthogonal complement of the frame `(x 0, y 0 + x 1 + y 1)` is the orthogonal sum of the\nanisotropic plane spanned by `x 1 + x 0` and `y 1 + x 0` and the hyperbolic plane spanned by `x 2`\nand `y 2`, so it is not exceptional. -/\nprivate theorem not_exc_orthogonal_span_pair_add [FiniteDimensional K V]\n {Q : QuadraticForm K V} (hB : Q.polarBilin.Nondegenerate) (hcard : Nat.card K = 2)\n (hn : finrank K V = 6) {x y : Fin 3 \u2192 V}\n (hxy : \u2200 i j, polar Q (x i) (y j) = if i = j then 1 else 0)\n (hxx : \u2200 i j, polar Q (x i) (x j) = 0) (hyy : \u2200 i j, polar Q (y i) (y j) = 0)\n (hQx\u2080 : Q (x 0) = 1) (hQx\u2081 : Q (x 1) = 0) (hQx\u2082 : Q (x 2) = 0) (hQy\u2081 : Q (y 1) = 0)\n (hQy\u2082 : Q (y 2) = 0) :\n \u00ac Exc (Q.restrict (LinearMap.BilinForm.orthogonal Q.polarBilin\n (Submodule.span K {x 0, y 0 + x 1 + y 1}))) := by\n refine not_exc_of_eq_smul_add_smul (by simpa using hxy 2 2) fun u hu hQu hCD \u21a6 ?_\n obtain \u27e8hx\u2080u, hfu\u27e9 := LinearMap.BilinForm.mem_orthogonal_span_pair_iff.mp hu\n rw [polarBilin_apply_apply] at hx\u2080u hfu\n rw [polar_add_left, polar_add_left] at hfu\n have hux\u2080 : polar Q u (x 0) = 0 := by rw [polar_comm, hx\u2080u]\n have huy\u2080 : polar Q u (y 0) = polar Q u (x 1) + polar Q u (y 1) := by\n rw [polar_comm _ u (y 0), polar_comm _ u (x 1), polar_comm _ u (y 1)]\n exact (add_eq_zero_iff_eq_of_charTwo K).mp (by rwa [add_assoc] at hfu)\n have hexp := eq_sum_polar_smul_add_polar_smul hB hxy hxx hyy hn u\n rw [Fin.sum_univ_three, hux\u2080, zero_smul, add_zero] at hexp\n have hyx (i j : Fin 3) : polar Q (y i) (x j) = if j = i then 1 else 0 := by\n rw [polar_comm, hxy]\n have hQ : 0 = polar Q u (y 0) * polar Q u (y 0) + polar Q u (x 1) * polar Q u (y 1) +\n polar Q u (x 2) * polar Q u (y 2) := by\n simpa [QuadraticMap.map_add (\u21d1Q), QuadraticMap.map_smul, polar_add_left, polar_add_right,\n polar_smul_left, polar_smul_right, hxy, hyx, hxx, hyy, hQx\u2080, hQx\u2081, hQx\u2082, hQy\u2081, hQy\u2082,\n hQu] using congrArg Q hexp\n rw [mul_comm] at hCD\n rw [huy\u2080, hCD, add_zero] at hQ\n obtain \u27e8h\u2081, h\u2082\u27e9 := eq_zero_and_eq_zero_of_natCard_eq_two hcard (p := polar Q u (x 1))\n (q := polar Q u (y 1)) (by linear_combination -hQ)\n simpa only [huy\u2080, h\u2081, h\u2082, add_zero, zero_smul, zero_add] using hexp\n\n/-- An exceptional polar orthogonal complement of a frame `(e, f)` contains two mutually\npolar-orthogonal singular vectors `s\u2081, s\u2082` with `e, f, s\u2081, s\u2082` linearly independent. -/\nprivate theorem exists_singular_pair_of_exc [FiniteDimensional K V] {Q : QuadraticForm K V}\n {e f : V}\n (hef : polar Q e f = 1) (hexc : Exc (Q.restrict\n (LinearMap.BilinForm.orthogonal Q.polarBilin (Submodule.span K {e, f})))) :\n \u2203 s\u2081 s\u2082 : V, polar Q e s\u2081 = 0 \u2227 polar Q f s\u2081 = 0 \u2227 polar Q e s\u2082 = 0 \u2227 polar Q f s\u2082 = 0 \u2227\n Q s\u2081 = 0 \u2227 Q s\u2082 = 0 \u2227 polar Q s\u2081 s\u2082 = 0 \u2227 LinearIndependent K ![e, f, s\u2081, s\u2082] := by\n set W := LinearMap.BilinForm.orthogonal Q.polarBilin (Submodule.span K {e, f})\n obtain \u27e8-, -, U', hU', hU'2\u27e9 := hexc\n set U := U'.map W.subtype\n have hU : Q.IsTotallyIsotropic U := isTotallyIsotropic_restrict_iff.mp hU'\n let b := Module.finBasisOfFinrankEq K U (by rw [Submodule.finrank_map_subtype_eq, hU'2])\n have hUW : U \u2264 W := Submodule.map_subtype_le W U'\n obtain \u27e8hes\u2081, hfs\u2081\u27e9 := LinearMap.BilinForm.mem_orthogonal_span_pair_iff.mp (hUW (b 0).property)\n obtain \u27e8hes\u2082, hfs\u2082\u27e9 := LinearMap.BilinForm.mem_orthogonal_span_pair_iff.mp (hUW (b 1).property)\n rw [polarBilin_apply_apply] at hes\u2081 hfs\u2081 hes\u2082 hfs\u2082\n have hfe : polar Q f e = 1 := by rw [polar_comm, hef]\n have hli\u2082 : LinearIndependent K ![(b 0 : V), b 1] := by\n convert b.linearIndependent.map' U.subtype U.ker_subtype using 1\n ext i\n fin_cases i <;> rfl\n refine \u27e8b 0, b 1, hes\u2081, hfs\u2081, hes\u2082, hfs\u2082, hU.apply_eq_zero (b 0).property,\n hU.apply_eq_zero (b 1).property, hU.polar_eq_zero (b 0).property (b 1).property,\n Fintype.linearIndependent_iff.mpr fun g hg \u21a6 ?_\u27e9\n simp only [Fin.sum_univ_four, Matrix.cons_val_zero, Matrix.cons_val_one, Matrix.cons_val_two,\n Matrix.cons_val_three, Matrix.head_cons, Matrix.tail_cons] at hg\n have h1 := congrArg (polar Q e) hg\n have h2 := congrArg (polar Q f) hg\n simp only [polar_add_right, polar_smul_right, polar_self_eq_zero_of_charTwo, hef, hfe, hes\u2081, hes\u2082,\n hfs\u2081, hfs\u2082, polar_zero_right, smul_eq_mul, mul_zero, mul_one, zero_add, add_zero] at h1 h2\n rw [h1, h2, zero_smul, zero_smul, zero_add, zero_add] at hg\n obtain \u27e8h3, h4\u27e9 := LinearIndependent.pair_iff.mp hli\u2082 (g 2) (g 3) hg\n intro i\n fin_cases i\n exacts [h2, h1, h3, h4]\n\n/-- Singular hyperbolic partners `s\u2081', s\u2082'` of `s\u2081, s\u2082` in the polar orthogonal complement of the\nframe `(e, f)`, with `s\u2081'` and `s\u2082'` polar orthogonal. -/\nprivate theorem exists_hyperbolic_partners [FiniteDimensional K V] {Q : QuadraticForm K V}\n (hB : Q.polarBilin.Nondegenerate) {e f s\u2081 s\u2082 : V} (hes\u2081 : polar Q e s\u2081 = 0)\n (hfs\u2081 : polar Q f s\u2081 = 0) (hes\u2082 : polar Q e s\u2082 = 0) (hfs\u2082 : polar Q f s\u2082 = 0)\n (hQs\u2081 : Q s\u2081 = 0) (hQs\u2082 : Q s\u2082 = 0) (hs\u2081s\u2082 : polar Q s\u2081 s\u2082 = 0)\n (hli : LinearIndependent K ![e, f, s\u2081, s\u2082]) :\n \u2203 s\u2081' s\u2082' : V, Q s\u2081' = 0 \u2227 Q s\u2082' = 0 \u2227 polar Q e s\u2081' = 0 \u2227 polar Q f s\u2081' = 0 \u2227\n polar Q e s\u2082' = 0 \u2227 polar Q f s\u2082' = 0 \u2227 polar Q s\u2081 s\u2081' = 1 \u2227 polar Q s\u2082 s\u2081' = 0 \u2227\n polar Q s\u2081 s\u2082' = 0 \u2227 polar Q s\u2082 s\u2082' = 1 \u2227 polar Q s\u2081' s\u2082' = 0 := by\n obtain \u27e8s\u2081', hQs\u2081', hs\u2081'\u27e9 := exists_hyperbolic_partner hB hli 2 hQs\u2081 fun j \u21a6 by\n fin_cases j <;> simp [hes\u2081, hfs\u2081, polar_self_eq_zero_of_charTwo Q,\n polar_comm (\u21d1Q) s\u2082 s\u2081, hs\u2081s\u2082]\n obtain \u27e8t, hQt, ht\u27e9 := exists_hyperbolic_partner hB hli 3 hQs\u2082 fun j \u21a6 by\n fin_cases j <;> simp [hes\u2082, hfs\u2082, polar_self_eq_zero_of_charTwo Q, hs\u2081s\u2082]\n have hes\u2081' : polar Q e s\u2081' = 0 := by simpa using hs\u2081' 0\n have hfs\u2081' : polar Q f s\u2081' = 0 := by simpa using hs\u2081' 1\n have hs\u2081s\u2081' : polar Q s\u2081 s\u2081' = 1 := by simpa using hs\u2081' 2\n have hs\u2082s\u2081' : polar Q s\u2082 s\u2081' = 0 := by simpa using hs\u2081' 3\n have het : polar Q e t = 0 := by simpa using ht 0\n have hft : polar Q f t = 0 := by simpa using ht 1\n have hs\u2081t : polar Q s\u2081 t = 0 := by simpa using ht 2\n have hs\u2082t : polar Q s\u2082 t = 1 := by simpa using ht 3\n refine \u27e8s\u2081', t + polar Q s\u2081' t \u2022 s\u2081, hQs\u2081', ?_, hes\u2081', hfs\u2081', ?_, ?_, hs\u2081s\u2081', hs\u2082s\u2081', ?_, ?_,\n ?_\u27e9\n \u00b7 rw [QuadraticMap.map_add (\u21d1Q), QuadraticMap.map_smul, hQt, hQs\u2081, polar_smul_right,\n polar_comm _ t s\u2081, hs\u2081t]\n simp\n \u00b7 simp [polar_add_right, polar_smul_right, het, hes\u2081]\n \u00b7 simp [polar_add_right, polar_smul_right, hft, hfs\u2081]\n \u00b7 simp [polar_add_right, polar_smul_right, hs\u2081t, polar_self_eq_zero_of_charTwo Q]\n \u00b7 simp [polar_add_right, polar_smul_right, hs\u2082t, polar_comm (\u21d1Q) s\u2082 s\u2081, hs\u2081s\u2082]\n \u00b7 rw [polar_add_right, polar_smul_right, polar_comm _ s\u2081' s\u2081, hs\u2081s\u2081', smul_eq_mul, mul_one,\n CharTwo.add_self_eq_zero]\n\n/-- **The frame switch.** If the polar orthogonal complement of a frame `(e, f)` is exceptional,\ntake singular vectors `s\u2081, s\u2082` spanning a totally isotropic plane of it, with hyperbolic partners\n`s\u2081', s\u2082'`. Then the frame `(e, f + s\u2081 + s\u2081')` is not exceptional\n(`not_exc_orthogonal_span_pair_add`). -/\nprivate theorem exists_frame_not_exc_of_exc [FiniteDimensional K V]\n {Q : QuadraticForm K V} (hB : Q.polarBilin.Nondegenerate) {e f : V} (he : Q e \u2260 0)\n (hef : polar Q e f = 1)\n (hexc : Exc (Q.restrict\n (LinearMap.BilinForm.orthogonal Q.polarBilin (Submodule.span K {e, f})))) :\n \u2203 e' f' : V, Q e' \u2260 0 \u2227 polar Q e' f' = 1 \u2227\n \u00ac Exc (Q.restrict\n (LinearMap.BilinForm.orthogonal Q.polarBilin (Submodule.span K {e', f'}))) := by\n have hcard := hexc.1\n have hn : finrank K V = 6 := by\n have := LinearMap.BilinForm.IsAlt.finrank_orthogonal_span_pair_add_two Q.isAlt_polarBilin\n (polarBilin_apply_eq_one_of_polar_eq_one hef)\n have := hexc.2.1\n omega\n obtain \u27e8s\u2081, s\u2082, hes\u2081, hfs\u2081, hes\u2082, hfs\u2082, hQs\u2081, hQs\u2082, hs\u2081s\u2082, hli\u27e9 :=\n exists_singular_pair_of_exc hef hexc\n obtain \u27e8s\u2081', s\u2082', hQs\u2081', hQs\u2082', hes\u2081', hfs\u2081', hes\u2082', hfs\u2082', hs\u2081s\u2081', hs\u2082s\u2081', hs\u2081s\u2082', hs\u2082s\u2082',\n hs\u2081's\u2082'\u27e9 := exists_hyperbolic_partners hB hes\u2081 hfs\u2081 hes\u2082 hfs\u2082 hQs\u2081 hQs\u2082 hs\u2081s\u2082 hli\n refine \u27e8e, f + s\u2081 + s\u2081', he, by rw [polar_add_right, polar_add_right, hef, hes\u2081, hes\u2081',\n add_zero, add_zero], ?_\u27e9\n exact not_exc_orthogonal_span_pair_add hB hcard hn (x := ![e, s\u2081, s\u2082])\n (y := ![f, s\u2081', s\u2082'])\n (fun i j \u21a6 by\n fin_cases i <;> fin_cases j <;> simp [hef, hes\u2081', hes\u2082', polar_comm (\u21d1Q) s\u2081 f, hfs\u2081,\n hs\u2081s\u2081', hs\u2081s\u2082', polar_comm (\u21d1Q) s\u2082 f, hfs\u2082, hs\u2082s\u2081', hs\u2082s\u2082'])\n (fun i j \u21a6 by\n fin_cases i <;> fin_cases j <;> simp [polar_self_eq_zero_of_charTwo Q, hes\u2081,\n hes\u2082, polar_comm (\u21d1Q) s\u2081 e, polar_comm (\u21d1Q) s\u2082 e, polar_comm (\u21d1Q) s\u2082 s\u2081, hs\u2081s\u2082])\n (fun i j \u21a6 by\n fin_cases i <;> fin_cases j <;> simp [polar_self_eq_zero_of_charTwo Q, hfs\u2081',\n hfs\u2082', polar_comm (\u21d1Q) s\u2081' f, polar_comm (\u21d1Q) s\u2082' f, polar_comm (\u21d1Q) s\u2082' s\u2081', hs\u2081's\u2082'])\n (by simpa using (natCard_eq_two_iff_forall_eq_zero_or_eq_one.mp hcard _).resolve_left he)\n hQs\u2081 hQs\u2082 hQs\u2081' hQs\u2082'\n\n/-- A frame `(e, f)` whose polar orthogonal complement is not exceptional. -/\nprivate theorem exists_frame_not_exc [FiniteDimensional K V] [Nontrivial V]\n {Q : QuadraticForm K V} (hB : Q.polarBilin.Nondegenerate) :\n \u2203 e f : V, Q e \u2260 0 \u2227 polar Q e f = 1 \u2227\n \u00ac Exc (Q.restrict\n (LinearMap.BilinForm.orthogonal Q.polarBilin (Submodule.span K {e, f}))) := by\n obtain \u27e8e, f, he, hef\u27e9 := exists_frame hB\n by_cases hexc : Exc (Q.restrict\n (LinearMap.BilinForm.orthogonal Q.polarBilin (Submodule.span K {e, f})))\n \u00b7 exact exists_frame_not_exc_of_exc hB he hef hexc\n \u00b7 exact \u27e8e, f, he, hef, hexc\u27e9\n\n/-- **Dieudonn\u00e9's theorem in characteristic two**, by induction on the dimension. -/\nprivate theorem eq_top_of_finrank_eq (n : \u2115) :\n \u2200 {W : Type v} [AddCommGroup W] [Module K W] [FiniteDimensional K W],\n finrank K W = n \u2192 \u2200 (Q : QuadraticForm K W), Q.polarBilin.Nondegenerate \u2192 \u00ac Exc Q \u2192\n \u2200 H : Subgroup (orthogonalGroup Q),\n (\u2200 a ha, reflectionOrthogonalOfNeZero Q a ha \u2208 H) \u2192 H = \u22a4 := by\n induction n using Nat.strong_induction_on with\n | ind n ih =>\n intro W _ _ _ hn Q hB hexc H hH\n rw [Subgroup.eq_top_iff']\n intro g\n rcases subsingleton_or_nontrivial W with hW | hW\n \u00b7 convert H.one_mem\n exact Subtype.ext (LinearEquiv.ext fun x \u21a6 Subsingleton.elim _ _)\n obtain \u27e8e, f, he, hef, hexc'\u27e9 := exists_frame_not_exc hB\n have hge : Q ((g : W \u2243\u2097[K] W) e) = Q e := map_app_of_mem_orthogonalGroup g.property e\n obtain \u27e8h\u2081, hh\u2081, hh\u2081e\u27e9 := exists_mem_apply_eq H hH\n (fun x y hxy hx hp hne \u21a6 exists_good hB hexc hxy hx hp hne) hge (by rwa [hge])\n have hg\u2081e : ((h\u2081 * g : orthogonalGroup Q) : W \u2243\u2097[K] W) e = e := by\n rw [orthogonalGroup.coe_mul_apply, hh\u2081e]\n have hg\u2081f : polar Q e (((h\u2081 * g : orthogonalGroup Q) : W \u2243\u2097[K] W) f) = 1 := by\n conv_lhs => rw [\u2190 hg\u2081e]\n rw [polar_apply_of_mem_orthogonalGroup (h\u2081 * g).property, hef]\n obtain \u27e8h\u2082, hh\u2082, hh\u2082e, hh\u2082f\u27e9 := exists_mem_fix_apply_eq H hH he hef hg\u2081f\n (map_app_of_mem_orthogonalGroup (h\u2081 * g).property f)\n have hdim := LinearMap.BilinForm.IsAlt.finrank_orthogonal_span_pair_add_two Q.isAlt_polarBilin\n (polarBilin_apply_eq_one_of_polar_eq_one hef)\n have hnd : (Q.restrict (LinearMap.BilinForm.orthogonal Q.polarBilin\n (Submodule.span K {e, f}))).polarBilin.Nondegenerate := by\n rw [polarBilin_restrict]\n exact LinearMap.BilinForm.IsAlt.restrict_nondegenerate_orthogonal_span_pair\n Q.isAlt_polarBilin (polarBilin_apply_eq_one_of_polar_eq_one hef) hB\n have hmem : h\u2082 * (h\u2081 * g) \u2208 H := by\n refine mem_of_apply_eq_self hef (fun H' hH' \u21a6 ih _ (by omega) rfl _ hnd hexc' H' hH') H hH\n _ ?_ ?_\n \u00b7 rw [orthogonalGroup.coe_mul_apply, hg\u2081e, hh\u2082e]\n \u00b7 rw [orthogonalGroup.coe_mul_apply, hh\u2082f]\n have hg : g = h\u2081\u207b\u00b9 * (h\u2082\u207b\u00b9 * (h\u2082 * (h\u2081 * g))) := by group\n rw [hg]\n exact H.mul_mem (H.inv_mem hh\u2081) (H.mul_mem (H.inv_mem hh\u2082) hmem)\n\nend Induction\n\n", "statement": "/-- **Dieudonn\u00e9's theorem.** Let `Q` be a quadratic form on a finite-dimensional vector space whose\npolar form is nondegenerate, and which is not isometric to the orthogonal sum of two hyperbolic\nplanes over a field with two elements. Then any subgroup of the orthogonal group of `Q` containing\nevery reflection `reflectionOrthogonal Q v` in a vector of invertible norm is the whole orthogonal\ngroup. In characteristic two these reflections are the orthogonal transvections\n`x \u21a6 x + (polar Q v x / Q v) \u2022 v`; in characteristic different from two this is the\nCartan--Dieudonn\u00e9 theorem `subgroup_eq_top_of_reflection_mem`. -/\ntheorem subgroup_eq_top_of_reflection_mem_of_nondegenerate_polarBilin [FiniteDimensional K V]\n (Q : QuadraticForm K V) (hQ : Q.polarBilin.Nondegenerate)\n (hexc : Nat.card K = 2 \u2192\n \u00ac Q.Equivalent (QuadraticMap.pi fun _ : Fin 2 \u21a6 binaryQuadraticForm K 0 0))\n (H : Subgroup (orthogonalGroup Q))\n (hreflection : \u2200 (v : V) [Invertible (Q v)], reflectionOrthogonal Q v \u2208 H) :\n H = \u22a4 ", "proof": " by\n by_cases h2 : (2 : K) = 0\n \u00b7 have : CharP K 2 := CharTwo.of_one_ne_zero_of_two_eq_zero one_ne_zero h2\n refine eq_top_of_finrank_eq _ rfl Q hQ ?_ H fun a ha \u21a6 ?_\n \u00b7 rintro \u27e8hcard, hdim, U, hU, hU2\u27e9\n exact hexc hcard\n ((equivalent_pi_binaryQuadraticForm_zero_iff_exists_isTotallyIsotropic_finrank_eq hQ\n (by omega)).mpr \u27e8U, hU, hU2\u27e9)\n \u00b7 let _ := invertibleOfNonzero ha\n rw [reflectionOrthogonalOfNeZero_eq]\n exact hreflection a\n \u00b7 have : NeZero (2 : K) := \u27e8h2\u27e9\n let _ := invertibleOfNonzero h2\n exact subgroup_eq_top_of_reflection_mem Q (nondegenerate_polar_iff.mp hQ) H hreflection", "proof_lines": 13, "proof_length": 571, "rev": "75c8aed5fea63047615a25a9763fd5b68a86e891", "heartbeats": 907, "image": "lean-compression:tauceti-75c8aed5fe-a608030cfc", "split": "dev"} {"path": "TauCeti/Analysis/PDE/SeibergWitten/NormalModel/CompressedInverse.lean", "module": "TauCeti.Analysis.PDE.SeibergWitten.NormalModel.CompressedInverse", "theorem": "TauCeti.SeibergWitten.starProjection_pairedFrequencyCoupling_compLpL", "prefix": "/-\nCopyright (c) 2026 The Tau Ceti contributors. All rights reserved.\nReleased under Apache 2.0 license as described in the file LICENSE.\nAuthors: The Tau Ceti contributors\n-/\nmodule\n\npublic import TauCeti.Analysis.PDE.SeibergWitten.NormalModel.Realization\npublic import TauCeti.Analysis.InnerProductSpace.InvariantSubspace\nimport TauCeti.MeasureTheory.Function.Lp.Basic\nimport TauCeti.MeasureTheory.Function.Lp.Norm\nimport TauCeti.MeasureTheory.Function.Lp.Operator.LpMultiplication\n\n/-!\n# The slow and fast blocks of the inverse of the frozen normal model\n\nNear a pseudoholomorphic curve, Taubes's rescaled large-parameter Seiberg\u2013Witten solutions are\nmodelled on `\u2102_base \u00d7 \u2102_normal` by a plane vortex `x` in the normal factor. At a base frequency\n`\u03be \u2208 \u2102` the frozen normal model is the bounded operator\n(`TauCeti.SeibergWitten.sobolevFrequencyNormalModel`)\n\n`T_\u03be (u, v) = (L_x u - b_N(\u03be) v, L_x* v + b_P(\u03be) u) : H\u00b9(\u2102)\u2074 \u00d7 H\u00b9(\u2102)\u2074 \u2192 L\u00b2 \u2295\u2082 L\u00b2`,\n\nwhere `L_x` is the gauge-fixed vortex operator and `b_P(\u03be) u = Re \u03be \u2022 u + Im \u03be \u2022 J u` is\nmultiplication by `\u03be` in the complex structure `J` of variations\n(`TauCeti.SeibergWitten.pairedFrequencyCoupling`). At a vortex it is invertible for every\n`\u03be \u2260 0` (`TauCeti.SeibergWitten.sobolevFrequencyNormalModelEquiv`), with\n`|\u03be| \u2016T_\u03be\u207b\u00b9 f\u2016_{L\u00b2} \u2264 \u2016f\u2016`. That bound degenerates as `\u03be \u2192 0`, because `L_x` has a kernel. This\nfile splits the inverse into a *slow* part, which carries the whole degeneration and is computed\nexactly, and a *fast* part, bounded uniformly in `\u03be`.\n\nLet `K \u2286 L\u00b2(\u2102; \u211d\u2074)` be the values of the kernel of `L_x : H\u00b9(\u2102)\u2074 \u2192 L\u00b2` and `\u03a0` the orthogonal\nprojection onto `K`, the slow variables of the model.\n\n* **The slow block is multiplication by `\u03be`.** `K` is preserved by `J`\n (`TauCeti.Vortex.sobolevVariationAlmostComplexStructure_mem_ker_sobolevGaugeFixedOperator`), so\n by `b_P(\u03be)` (`pairedFrequencyCoupling_compLpL_mem_map_ker_sobolevGaugeFixedOperator`), and so is\n its orthogonal complement, since `b_P(\u03be)\u2020 = b_P(conj \u03be)`. Hence `\u03a0` commutes with `b_P(\u03be)`\n (`starProjection_pairedFrequencyCoupling_compLpL`). The range of `L_x*` is orthogonal to `K`\n (`TauCeti.Vortex.starProjection_sobolevGaugeFixedAdjoint_eq_zero`), so the slow component of\n the paired row only sees the slow component of `u`:\n `\u03a0 (L_x* v + b_P(\u03be) u) = b_P(\u03be) (\u03a0 u)` (`starProjection_snd_sobolevFrequencyNormalModel`).\n* **The band estimate on `H\u00b9`.** If `c \u222b |\u03b7|\u00b2 \u2264 \u222b |L_x* \u03b7|\u00b2` on test fields, as at every vortex by\n the spectral gap of `L_x L_x*`, then `c \u2016\u03b7\u2016\u00b2 \u2264 \u2016L_x* \u03b7\u2016\u00b2` on `H\u00b9` and\n `c \u2016u - \u03a0 u\u2016\u00b2 \u2264 \u2016L_x u\u2016\u00b2`\n (`TauCeti.Vortex.mul_norm_sub_starProjection_sq_le_norm_sobolevGaugeFixedOperator_sq`), so the\n energy identity of the model gives, for all `(u, v)` and all `\u03be`,\n `c (\u2016u - \u03a0 u\u2016\u00b2 + \u2016v\u2016\u00b2) + |\u03be|\u00b2 (\u2016u\u2016\u00b2 + \u2016v\u2016\u00b2) \u2264 \u2016T_\u03be (u, v)\u2016\u00b2`\n (`mul_add_add_le_norm_sobolevFrequencyNormalModel_sq`), the `H\u00b9` form of\n `TauCeti.SeibergWitten.mul_add_add_le_integral_norm_sq_add_norm_sq_frequencyNormalModel`.\n* **The compressed inverse.** For `\u03be \u2260 0` and `(u, v) = T_\u03be\u207b\u00b9 f`, the slow component of `u` is\n `\u03a0 u = b_P(\u03be\u207b\u00b9) (\u03a0 f\u2082)` (`starProjection_fst_sobolevFrequencyNormalModelEquiv_symm`), of norm\n `|\u03be|\u207b\u00b9 \u2016\u03a0 f\u2082\u2016` (`norm_starProjection_fst_sobolevFrequencyNormalModelEquiv_symm`): the inverse of\n the slow block is multiplication by `\u03be\u207b\u00b9`. The fast components satisfy\n `c (\u2016u - \u03a0 u\u2016\u00b2 + \u2016v\u2016\u00b2) \u2264 \u2016f\u2016\u00b2`\n (`mul_norm_sub_starProjection_sq_add_norm_sq_sobolevFrequencyNormalModelEquiv_symm_le`).\n In `H\u00b9`, there is a constant `C`, independent of `\u03be`, such that `u = k + w` with `k` in the\n kernel of `L_x` and with values `b_P(\u03be\u207b\u00b9) (\u03a0 f\u2082)`, `\u2016w\u2016_{H\u00b9} \u2264 C \u2016f\u2016` and `\u2016v\u2016_{H\u00b9} \u2264 C \u2016f\u2016`\n (`exists_forall_exists_mem_ker_norm_sobolevFrequencyNormalModelEquiv_symm_sub_le`); here\n `w = Q (L_x u)` for the right inverse `Q` of `L_x` with values orthogonal to its kernel.\n\nSo the inverse of the frozen model is `\u03be\u207b\u00b9` on the slow block plus a family of operators bounded\nuniformly in the frequency. The model is frozen: along a curve the vortex moves with a divisor,\nand the moving projections contribute commutator terms, which are not treated here.\n\n## Main results\n\n* `starProjection_snd_sobolevFrequencyNormalModel`: the slow component of the paired row.\n* `mul_add_add_le_norm_sobolevFrequencyNormalModel_sq`: the band estimate on `H\u00b9`.\n* `starProjection_fst_sobolevFrequencyNormalModelEquiv_symm`,\n `norm_starProjection_fst_sobolevFrequencyNormalModelEquiv_symm`: the slow part of the inverse.\n* `mul_norm_sub_starProjection_sq_add_norm_sq_sobolevFrequencyNormalModelEquiv_symm_le`,\n `exists_forall_exists_mem_ker_norm_sobolevFrequencyNormalModelEquiv_symm_sub_le`: the fast part\n of the inverse is bounded uniformly in the frequency.\n\n## References\n\n* C. H. Taubes, *Gr \u21d2 SW: From pseudo-holomorphic curves to Seiberg\u2013Witten solutions*,\n J. Differential Geom. 51 (1999), 203\u2013334.\n-/\n\npublic section\n\nnoncomputable section\n\nnamespace TauCeti.SeibergWitten\n\nopen Complex MeasureTheory Filter TopologicalSpace Module\nopen scoped ENNReal Topology RealInnerProductSpace ComplexConjugate\n\nlocal notation \"\u03bc\u22a4\" => Measure.restrict (volume : Measure \u2102) ((\u22a4 : Opens \u2102) : Set \u2102)\n\n/-! ### The paired coupling on `L\u00b2` -/\n\nsection Coupling\n\nvariable {\u03b1 : Type*} [MeasurableSpace \u03b1] {\u03bc : Measure \u03b1}\n\n/-- On `L\u00b2`, the paired coupling is `g \u21a6 Re \u03be \u2022 g + Im \u03be \u2022 J g`. -/\nprivate theorem pairedFrequencyCoupling_compLpL_apply (\u03be : \u2102)\n (g : Lp (EuclideanSpace \u211d (Fin 4)) 2 \u03bc) :\n (pairedFrequencyCoupling \u03be).compLpL 2 \u03bc g = \u03be.re \u2022 g + \u03be.im \u2022\n Vortex.variationComplexStructure.toContinuousLinearEquiv.toContinuousLinearMap.compLp g := by\n set J := Vortex.variationComplexStructure.toContinuousLinearEquiv.toContinuousLinearMap\n have h : pairedFrequencyCoupling \u03be = \u03be.re \u2022 ContinuousLinearMap.id \u211d _ + \u03be.im \u2022 J := by\n ext1 u\n simp [pairedFrequencyCoupling_apply, J]\n rw [h, ContinuousLinearMap.add_compLpL, ContinuousLinearMap.smul_compLpL,\n ContinuousLinearMap.smul_compLpL, ContinuousLinearMap.id_compLpL,\n add_apply, smul_apply, smul_apply, ContinuousLinearMap.id_apply,\n ContinuousLinearMap.compLpL_apply]\n\n/-- On `L\u00b2`, the paired coupling at `\u03be\u207b\u00b9` inverts the paired coupling at `\u03be \u2260 0`. -/\nprivate theorem pairedFrequencyCoupling_inv_compLpL_apply {\u03be : \u2102} (h\u03be : \u03be \u2260 0)\n (g : Lp (EuclideanSpace \u211d (Fin 4)) 2 \u03bc) :\n (pairedFrequencyCoupling \u03be\u207b\u00b9).compLpL 2 \u03bc ((pairedFrequencyCoupling \u03be).compLpL 2 \u03bc g) = g := by\n rw [ContinuousLinearMap.compLpL_compLpL, pairedFrequencyCoupling_inv_comp h\u03be,\n ContinuousLinearMap.id_compLpL, ContinuousLinearMap.id_apply]\n\n/-- On `L\u00b2`, the paired coupling multiplies norms by `|\u03be|`. -/\ntheorem norm_pairedFrequencyCoupling_compLpL_apply (\u03be : \u2102)\n (g : Lp (EuclideanSpace \u211d (Fin 4)) 2 \u03bc) :\n \u2016(pairedFrequencyCoupling \u03be).compLpL 2 \u03bc g\u2016 = \u2016\u03be\u2016 * \u2016g\u2016 := by\n have h : \u2016(pairedFrequencyCoupling \u03be).compLpL 2 \u03bc g\u2016 ^ 2 = (\u2016\u03be\u2016 * \u2016g\u2016) ^ 2 := by\n rw [Lp.norm_sq_eq_integral_of_ae_eq ((pairedFrequencyCoupling \u03be).coeFn_compLpL g),\n mul_pow, Lp.norm_sq_eq_integral_of_ae_eq (EventuallyEq.refl _ _), \u2190 integral_const_mul]\n simp only [norm_pairedFrequencyCoupling_apply, mul_pow]\n exact (pow_left_inj\u2080 (norm_nonneg _) (by positivity) two_ne_zero).1 h\n\nend Coupling\n\nvariable {a : Lp (EuclideanSpace \u211d (Fin 4)) \u221e \u03bc\u22a4}\n\n/-- **The paired coupling preserves the values of the kernel of `L_x`.** For every `L\u221e`\ncoefficient `a` and frequency `\u03be`, postcomposition by `b_P(\u03be)` maps the values of the kernel of\nthe realization of `L_x` on `H\u00b9` to themselves, since that kernel is preserved by `J`. -/\ntheorem pairedFrequencyCoupling_compLpL_mem_map_ker_sobolevGaugeFixedOperator (\u03be : \u2102)\n {g : Lp (EuclideanSpace \u211d (Fin 4)) 2 \u03bc\u22a4}\n (hg : g \u2208 (Vortex.sobolevGaugeFixedOperator a).ker.map Vortex.sobolevFieldValues.toLinearMap) :\n (pairedFrequencyCoupling \u03be).compLpL 2 \u03bc\u22a4 g \u2208\n (Vortex.sobolevGaugeFixedOperator a).ker.map Vortex.sobolevFieldValues.toLinearMap := by\n obtain \u27e8y, hy, rfl\u27e9 := hg\n refine \u27e8\u03be.re \u2022 y + \u03be.im \u2022 Vortex.sobolevVariationAlmostComplexStructure y,\n Submodule.add_mem _ (Submodule.smul_mem _ _ hy) (Submodule.smul_mem _ _\n (Vortex.sobolevVariationAlmostComplexStructure_mem_ker_sobolevGaugeFixedOperator hy)), ?_\u27e9\n simp only [ContinuousLinearMap.coe_coe, map_add, map_smul,\n Vortex.sobolevFieldValues_sobolevVariationAlmostComplexStructure]\n rw [pairedFrequencyCoupling_compLpL_apply]\n\n", "statement": "/-- **The projection onto the slow variables commutes with the paired coupling.** For every `L\u221e`\ncoefficient `a` and frequency `\u03be`, the orthogonal projection `\u03a0` onto the values of the kernel of\nthe realization of `L_x` commutes with postcomposition by `b_P(\u03be)`: the kernel is preserved by\n`b_P(\u03be)` and by its adjoint `b_P(conj \u03be)`, so it reduces `b_P(\u03be)`. -/\ntheorem starProjection_pairedFrequencyCoupling_compLpL (\u03be : \u2102)\n [((Vortex.sobolevGaugeFixedOperator a).ker.map\n Vortex.sobolevFieldValues.toLinearMap).HasOrthogonalProjection]\n (g : Lp (EuclideanSpace \u211d (Fin 4)) 2 \u03bc\u22a4) :\n ((Vortex.sobolevGaugeFixedOperator a).ker.map\n Vortex.sobolevFieldValues.toLinearMap).starProjection\n ((pairedFrequencyCoupling \u03be).compLpL 2 \u03bc\u22a4 g) =\n (pairedFrequencyCoupling \u03be).compLpL 2 \u03bc\u22a4\n (((Vortex.sobolevGaugeFixedOperator a).ker.map\n Vortex.sobolevFieldValues.toLinearMap).starProjection g) ", "proof": " by\n set K := (Vortex.sobolevGaugeFixedOperator a).ker.map Vortex.sobolevFieldValues.toLinearMap\n have hred : K.IsReducing ((pairedFrequencyCoupling \u03be).compLpL 2 \u03bc\u22a4 :\n Lp (EuclideanSpace \u211d (Fin 4)) 2 \u03bc\u22a4 \u2192L[\u211d] Lp (EuclideanSpace \u211d (Fin 4)) 2 \u03bc\u22a4) := by\n refine ContinuousLinearMap.isReducing_iff_mem_invtSubmodule_adjoint.2\n \u27e8fun g hg \u21a6 pairedFrequencyCoupling_compLpL_mem_map_ker_sobolevGaugeFixedOperator \u03be hg,\n fun g hg \u21a6 ?_\u27e9\n rw [Submodule.mem_comap, ContinuousLinearMap.coe_coe, ContinuousLinearMap.adjoint_compLpL,\n adjoint_pairedFrequencyCoupling]\n exact pairedFrequencyCoupling_compLpL_mem_map_ker_sobolevGaugeFixedOperator (conj \u03be) hg\n exact congr($((Submodule.isReducing_coe_iff_commute_starProjection.1 hred).eq) g)", "proof_lines": 10, "proof_length": 713, "rev": "75c8aed5fea63047615a25a9763fd5b68a86e891", "heartbeats": 5237, "image": "lean-compression:tauceti-75c8aed5fe-a608030cfc", "split": "dev"} {"path": "TauCeti/Geometry/Symplectic/Floer/CylinderAction.lean", "module": "TauCeti.Geometry.Symplectic.Floer.CylinderAction", "theorem": "TauCeti.SmoothTwoForm.IsNondegenerate.integral_floerEnergyDensity_eq_contractibleLoopAction_sub_sub_integral", "prefix": "/-\nCopyright (c) 2026 The Tau Ceti contributors. All rights reserved.\nReleased under Apache 2.0 license as described in the file LICENSE.\nAuthors: The Tau Ceti contributors\n-/\nmodule\n\npublic import TauCeti.Geometry.Symplectic.Floer.Continuation\npublic import TauCeti.Geometry.Symplectic.Floer.Manifold\npublic import TauCeti.Geometry.Symplectic.Hamiltonian.Action.Basic\npublic import TauCeti.Geometry.Symplectic.Hamiltonian.ContractibleAction.Basic\npublic import TauCeti.Geometry.Symplectic.Hamiltonian.ContractibleAction.Capped\nimport TauCeti.Analysis.Calculus.FDeriv.Prod\nimport TauCeti.Geometry.Symplectic.Manifold.Energy\nimport TauCeti.MeasureTheory.Integral.DominatedConvergence\nimport TauCeti.MeasureTheory.Integral.IntegralEqImproper\nimport TauCeti.MeasureTheory.Integral.Rectangle\n\n/-!\n# The energy of Floer cylinders in a manifold and the action of their loops\n\nLet `\u03c9` be a nondegenerate two-form on a finite-dimensional manifold `M` and `H : \u211d \u2192 M \u2192 \u211d` a\n`C\u00b9` time-dependent Hamiltonian. A Floer cylinder for `H` is a map `u : \u211d \u00d7 \u211d \u2192 M`, `1`-periodic\nin `t`, solving `\u2202_s u + J (\u2202_t u - X_{H_t}(u)) = 0`, with the convention `\u03b9_{X_H} \u03c9 = dH`. It is\nthe inhomogeneous Floer equation for the **cylindrical perturbation** `K = H_t dt`, whose `ds`\ncomponent vanishes and whose `dt` component does not depend on `s`; the curvature of such a\nperturbation vanishes (`TauCeti.SmoothTwoForm.hamiltonianCurvature_cylindrical`).\n\nThe energy identity for manifold targets\n(`TauCeti.SmoothTwoForm.IsNondegenerate.integral_floerEnergyDensity`) then says that the Floer\nenergy of a `C\u00b9` map over `[a, b] \u00d7 [0, 1]` is its symplectic area plus the Hamiltonian terms of\nits two boundary loops `\u03b3_a = u(a, \u00b7)` and `\u03b3_b = u(b, \u00b7)`:\n\n`E(u) = \u222b u^* \u03c9 + \u222b\u2080\u00b9 H(t, \u03b3_b(t)) dt - \u222b\u2080\u00b9 H(t, \u03b3_a(t)) dt`\n\n(`TauCeti.SmoothTwoForm.IsNondegenerate.integral_floerEnergyDensity_cylindrical`). This file\nrewrites the right-hand side as a difference of actions of the two loops, in five settings.\n\n* For an arbitrary nondegenerate form, such as the symplectic form of a closed monotone\n manifold, and a `C\u00b9` map `v` with `v (0, \u00b7) = \u03b3_b`, the energy is\n `A_H(\u03b3_a, w # v) - A_H(\u03b3_b, v)` for the action `A_H(\u03b3, u) = \u222b u^* \u03c9 - \u222b\u2080\u00b9 H(t, \u03b3(t)) dt` of\n `\u03b3` measured against `u` (`TauCeti.cylinderAction`), where `w` is `u` on `[a, b] \u00d7 \u211d` rescaled\n to `[0, 1] \u00d7 \u211d`\n (`SmoothTwoForm.IsNondegenerate.integral_floerEnergyDensity_eq_cylinderAction_sub`). When `v`\n is a cap of `\u03b3_b`, `w # v` is a cap of `\u03b3_a`, and the energy is the drop of the capped action.\n For an `s`-dependent family `G_z` (see continuation cylinders below) the two actions are taken\n for the Hamiltonians `G(a, \u00b7)` and `G(b, \u00b7)` at the two ends and the integrated curvature is\n subtracted\n (`SmoothTwoForm.IsNondegenerate.integral_floerEnergyDensity_eq_cylinderAction_sub_sub_integral`).\n* For an arbitrary form, such as the symplectic form of a closed symplectic manifold, the actions\n depend on caps. For a disc `D` bounding `\u03b3_a`, the map `u` glued to `D` is a disc `D \u22c6 u` bounding\n `\u03b3_b`, and the energy is `A_H(\u03b3_b, D \u22c6 u) - A_H(\u03b3_a, D)` for the capped action\n `A_H(\u03b3, D) = \u222b D^* \u03c9 + \u222b\u2080\u00b9 H(t, \u03b3(t)) dt` (`TauCeti.cappedLoopAction`)\n (`SmoothTwoForm.IsNondegenerate.integral_floerEnergyDensity_eq_cappedLoopAction_sub`). With\n reference discs `D_a` of `\u03b3_a` and `D_b` of `\u03b3_b` chosen independently, the energy is\n `A_H(\u03b3_b, D_b) - A_H(\u03b3_a, D_a) + \u03c9(A)` for the sphere `A = D_a \u22c6 u \u22c6 D_b\u207b\u00b9`, the class of the\n cylinder relative to its reference discs\n (`SmoothTwoForm.IsNondegenerate.integral_floerEnergyDensity_eq_cappedLoopAction_sub_add`).\n* For a weakly exact form (`TauCeti.IsWeaklyExact`, the area half of symplectic asphericity) and\n a `C\u00b2` cylinder whose loop `\u03b3_b` bounds a cap, the energy is `A_H(\u03b3_a) - A_H(\u03b3_b)` for the\n action `A_H(\u03b3) = \u222b v^* \u03c9 - \u222b\u2080\u00b9 H(t, \u03b3(t)) dt` of contractible loops\n (`TauCeti.contractibleLoopAction`), the cap `v` running from `\u03b3` to its centre\n (`SmoothTwoForm.IsNondegenerate.integral_floerEnergyDensity_eq_contractibleLoopAction_sub`).\n* For an exact form `\u03c9 = d\u03b1`, such as the form of a Liouville domain, no cap is needed: for every\n `C\u00b2` cylinder the energy is `A_H(\u03b3_a) - A_H(\u03b3_b)` for the action\n `A_H(\u03b3) = -\u222b_\u03b3 \u03b1 - \u222b\u2080\u00b9 H(t, \u03b3(t)) dt` of arbitrary loops\n (`TauCeti.SmoothTwoForm.IsNondegenerate.integral_floerEnergyDensity_eq_sub_of_mextDeriv_eq`).\n* For a form vanishing on tori (`TauCeti.VanishesOnTori`, the area half of symplectic\n atoroidality) and a smooth map `u` whose loop `\u03b3_b` is joined to a reference loop `\u03b3\u2080` by a\n smooth cylinder, the energy is `\ud835\udc9c_H(\u03b3_a) - \ud835\udc9c_H(\u03b3_b)` for the action\n `\ud835\udc9c_H(\u03b3) = \u222b \u0393^* \u03c9 - \u222b\u2080\u00b9 H(t, \u03b3(t)) dt` relative to `\u03b3\u2080`\n (`TauCeti.SmoothTwoForm.referenceAction`), the cylinder `\u0393` running from `\u03b3` to `\u03b3\u2080`\n (`TauCeti.SmoothTwoForm.IsNondegenerate.integral_floerEnergyDensity_eq_referenceAction_sub`).\n Choosing one reference loop in each free homotopy class, this is the energy identity on the\n whole free loop space, not only on contractible loops.\n\n**Seamed strips.** The Floer theory of a symplectomorphism `f` replaces loops by `f`-seamed\npaths, `\u03b3 1 = f (\u03b3 0)`, and Floer cylinders by strips through them, `u (s, 1) = f (u (s, 0))`.\nThe energy identity over `[a, b] \u00d7 [0, 1]` needs no periodicity, so it applies to these strips\nas it stands. For a form vanishing on `f`-seamed tori (`TauCeti.VanishesOnSeamedTori`) and a strip\nwhose path `\u03b3_b` is joined to a reference path `\u03b3\u2080` by a smooth `f`-seamed cylinder, the energy is\n`\ud835\udc9c_H(\u03b3_a) - \ud835\udc9c_H(\u03b3_b)` for the action of seamed paths relative to `\u03b3\u2080`\n(`TauCeti.SmoothTwoForm.seamedReferenceAction`,\n`TauCeti.SmoothTwoForm.IsNondegenerate.integral_floerEnergyDensity_eq_seamedReferenceAction_sub`);\nfor an `s`-dependent family `G_z` the integral of `\u2202_s G` along `u` is subtracted\n(`IsNondegenerate.integral_floerEnergyDensity_eq_seamedReferenceAction_sub_sub_integral`). The\naction relative to a reference loop is the case `f = id`. As for loops, the action relative to\n`\u03b3\u2080` decreases along seamed Floer strips\n(`TauCeti.SmoothTwoForm.IsNondegenerate.seamedReferenceAction_le_seamedReferenceAction`), monotone\nhomotopies preserve this filtration\n(`SmoothTwoForm.IsNondegenerate.seamedReferenceAction_le_seamedReferenceAction_of_monotone`), and\na seamed continuation strip from `H\u2080` to `H\u2081` shifts it by at most `\u222b\u2080\u00b9 h` when `H\u2080 - H\u2081 \u2264 h`\n(`IsNondegenerate.seamedReferenceAction_le_seamedReferenceAction_add_of_continuationHomotopy`).\n\nFor a solution of the Floer equation and almost complex structures tamed by `\u03c9`, the energy\ndensity is nonnegative\n(`TauCeti.SmoothTwoForm.IsNondegenerate.floerEnergyDensity_zero_left_nonneg`), so the capped\naction decreases along a Floer cylinder when the caps are glued along it\n(`TauCeti.SmoothTwoForm.IsNondegenerate.cylinderAction_le_cylinderAction`), for a weakly exact\nform the contractible action of the loops decreases\n(`TauCeti.SmoothTwoForm.IsNondegenerate.contractibleLoopAction_le_contractibleLoopAction`), and\nfor a form vanishing on tori so does the action relative to a reference loop\n(`TauCeti.SmoothTwoForm.IsNondegenerate.referenceAction_le_referenceAction`). In the opposite\nconvention of `TauCeti.cappedLoopAction`, the capped action increases along a Floer cylinder when\nthe disc is transported along it\n(`TauCeti.SmoothTwoForm.IsNondegenerate.cappedLoopAction_le_cappedLoopAction`).\nThis monotonicity underlies the action filtration of the Floer complex.\n\n**Continuation cylinders.** For an `s`-dependent family of Hamiltonians `G_z`, `z = (s, t)`, the\nperturbation `K = G_z dt` has curvature `\u2202_s G`, and the energy picks up the integral of\n`-\u2202_s G` along `u`\n(`TauCeti.SmoothTwoForm.IsNondegenerate.integral_floerEnergyDensity_zero_left`). For a weakly\nexact form,\n\n`E(u) = A_{G(a, \u00b7)}(\u03b3_a) - A_{G(b, \u00b7)}(\u03b3_b) - \u222b\u222b (\u2202_s G)(s, t, u(s, t))`\n\n(`IsNondegenerate.integral_floerEnergyDensity_eq_contractibleLoopAction_sub_sub_integral`), so\nalong a solution the action at `s = b` is at most the action at `s = a` minus the integral of\n`\u2202_s G`. Hence:\n\n* **monotone homotopies preserve the action filtration**: if every `s \u21a6 G_{(s, t)}(x)` is\n monotone, the action decreases along the cylinder\n (`SmoothTwoForm.IsNondegenerate.contractibleLoopAction_le_contractibleLoopAction_of_monotone`);\n* **general homotopies shift it by at most a Hofer-type bound**: for the continuation homotopy\n `G = H\u2080 + \u03b2(s) (H\u2081 - H\u2080)` (`TauCeti.Floer.continuationHomotopy`) and a cylinder over\n `[a, b] \u00d7 [0, 1]` with `a \u2264 0` and `1 \u2264 b`, if `H\u2080 - H\u2081 \u2264 h` for an integrable `h` on `[0, 1]`,\n then `A_{H\u2081}(\u03b3_b) \u2264 A_{H\u2080}(\u03b3_a) + \u222b\u2080\u00b9 h`, whatever the length of the cylinder\n (`IsNondegenerate.contractibleLoopAction_le_contractibleLoopAction_add_of_continuationHomotopy`).\n When `h(t) = sup_x (H\u2080 - H\u2081)(t, x)` is finite and integrable on `[0, 1]`, for instance on a\n compact manifold, this is the shift `\u222b\u2080\u00b9 sup_x (H\u2080 - H\u2081) dt` of the filtration by continuation\n maps.\n\nThese are the manifold-target, capped-action versions of the estimates of\n`TauCeti.Geometry.Symplectic.Floer.Continuation` for a symplectic vector space. The curvature\n`\u2202_s G(z, u z)` along a `C\u00b9` map is continuous, as a partial derivative of the `C\u00b9` map\n`(z, y) \u21a6 G z (u y)` on `\u211d\u00b2 \u00d7 \u211d\u00b2`, so no integrability hypothesis is needed. The existence,\ncompactness and counting of continuation cylinders are not treated here.\n\n**The whole cylinder.** All of the above concern a rectangle `[a, b] \u00d7 [0, 1]`. Letting\n`a \u2192 -\u221e` and `b \u2192 \u221e` gives the identity for a solution asymptotic to loops `x\u2080` at `s = -\u221e` and\n`x\u2081` at `s = \u221e`. For a perturbation `K = K_s ds + K_t dt` equal to `H\u2080(t) dt` for `s \u2264 -c` and\n`H\u2081(t) dt` for `s \u2265 c`, bounded for `t \u2208 [0, 1]`, and a `C\u00b9` map `u` along whose two edges the\n`ds` components agree, `K_s(s, 1)(u(s, 1)) = K_s(s, 0)(u(s, 0))`, as for a loop of loops with\n`K_s(s, 1) = K_s(s, 0)` or for a strip through `f`-seamed paths with `K_s(s, 1) \u2218 f = K_s(s, 0)`,\nand whose energy, area and curvature densities are integrable over the strip `\u211d \u00d7 [0, 1]`,\n\n`\u222b E = \u222b u^*\u03c9 + \u222b\u2080\u00b9 H\u2081(t, x\u2081(t)) dt - \u222b\u2080\u00b9 H\u2080(t, x\u2080(t)) dt - \u222b R_K(u)`\n\n(`TauCeti.SmoothTwoForm.IsNondegenerate.integral_floerEnergyDensity_univ_prod`), as soon as the\nloops `u(a i, \u00b7)` and `u(b i, \u00b7)` converge pointwise to `x\u2080` and `x\u2081` along some `a i \u2192 -\u221e` and\n`b i \u2192 \u221e`, for instance along sequences. For a Floer cylinder, `K = H_t dt`, the curvature term\nvanishes and no condition relates `u(s, 1)` to `u(s, 0)`\n(`IsNondegenerate.integral_floerEnergyDensity_cylindrical_univ_prod`), and nonnegativity of the\nenergy gives `\u222b\u2080\u00b9 H(t, x\u2080(t)) dt \u2264 \u222b u^*\u03c9 + \u222b\u2080\u00b9 H(t, x\u2081(t)) dt`\n(`IsNondegenerate.intervalIntegral_le_integral_add_intervalIntegral_of_cylindrical`): the capped\naction increases from the negative to the positive asymptotic orbit, with the cap glued along\nthe whole cylinder.\n\n## Main results\n\n* `TauCeti.Floer.neg_setIntegral_fderiv_le_setIntegral`: the integrated curvature of a homotopy\n along a map is bounded below by `-\u222b_a^b c` for `-\u2202_s G \u2264 c(s)`.\n* `TauCeti.Floer.neg_setIntegral_fderiv_linearHomotopy_le`: the integrated curvature of a linear\n homotopy with a monotone profile along a map is bounded below by `-(\u03b2(b) - \u03b2(a)) \u222b\u2080\u00b9 B` for\n `H\u2080 - H\u2081 \u2264 B`.\n* `TauCeti.SmoothTwoForm.IsNondegenerate.integral_floerEnergyDensity_zero_left`: the energy of a\n map over `[a, b] \u00d7 [0, 1]` for a perturbation `K = G_z dt`.\n* `TauCeti.SmoothTwoForm.IsNondegenerate.integral_floerEnergyDensity_cylindrical`: the energy of a\n map over `[a, b] \u00d7 [0, 1]` for a cylindrical perturbation.\n* `TauCeti.SmoothTwoForm.IsNondegenerate.integral_floerEnergyDensity_univ_prod`: the energy of a\n map over the whole cylinder, with the Hamiltonian terms at its asymptotic loops.\n* `SmoothTwoForm.IsNondegenerate.integral_floerEnergyDensity_eq_cylinderAction_sub`: the energy\n of a cylinder is the drop of the capped action, for any nondegenerate form.\n* `SmoothTwoForm.IsNondegenerate.integral_floerEnergyDensity_eq_cylinderAction_sub_sub_integral`:\n the same for a perturbation `K = G_z dt`, corrected by the curvature.\n* `TauCeti.SmoothTwoForm.IsNondegenerate.cylinderAction_le_cylinderAction`: the capped action\n decreases along Floer cylinders.\n* `IsNondegenerate.integral_floerEnergyDensity_eq_contractibleLoopAction_sub_sub_integral`,\n `SmoothTwoForm.IsNondegenerate.integral_floerEnergyDensity_eq_contractibleLoopAction_sub`: for a\n weakly exact form, the energy of a cylinder is the drop of the contractible action, corrected by\n the curvature for an `s`-dependent perturbation.\n* `SmoothTwoForm.IsNondegenerate.integral_floerEnergyDensity_eq_cappedLoopAction_sub`: the energy\n of a cylinder is the increase of the capped action, with the disc transported along it.\n* `SmoothTwoForm.IsNondegenerate.integral_floerEnergyDensity_eq_cappedLoopAction_sub_add`: the\n energy of a cylinder with reference discs at both ends.\n* `TauCeti.SmoothTwoForm.IsNondegenerate.integral_floerEnergyDensity_eq_sub_of_mextDeriv_eq`: for\n an exact form, the energy of a cylinder is the drop of the action of its loops.\n* `TauCeti.SmoothTwoForm.IsNondegenerate.contractibleLoopAction_le_contractibleLoopAction`: the\n contractible action decreases along Floer cylinders.\n* `TauCeti.SmoothTwoForm.IsNondegenerate.cappedLoopAction_le_cappedLoopAction`: the capped action\n increases along Floer cylinders.\n* `IsNondegenerate.integral_floerEnergyDensity_eq_seamedReferenceAction_sub_sub_integral`,\n `TauCeti.SmoothTwoForm.IsNondegenerate.integral_floerEnergyDensity_eq_seamedReferenceAction_sub`:\n for a form vanishing on `f`-seamed tori, the energy of a strip through `f`-seamed paths is the\n drop of the action relative to a reference path, corrected by the curvature for an\n `s`-dependent perturbation.\n* `SmoothTwoForm.IsNondegenerate.seamedReferenceAction_le_seamedReferenceAction_sub_integral`,\n `TauCeti.SmoothTwoForm.IsNondegenerate.seamedReferenceAction_le_seamedReferenceAction`,\n `SmoothTwoForm.IsNondegenerate.seamedReferenceAction_le_seamedReferenceAction_of_monotone`: the\n action relative to a reference path along seamed Floer strips, and its monotone case.\n* `IsNondegenerate.seamedReferenceAction_le_seamedReferenceAction_add_of_linearHomotopy`,\n `IsNondegenerate.seamedReferenceAction_le_seamedReferenceAction_add_of_continuationHomotopy`:\n the action shift along seamed strips of a linear homotopy and of the continuation homotopy.\n* `TauCeti.SmoothTwoForm.IsNondegenerate.integral_floerEnergyDensity_eq_referenceAction_sub`: for a\n form vanishing on tori, the energy of a cylinder is the drop of the action relative to a\n reference loop.\n* `TauCeti.SmoothTwoForm.IsNondegenerate.referenceAction_le_referenceAction`: the action relative\n to a reference loop decreases along Floer cylinders.\n* `SmoothTwoForm.IsNondegenerate.contractibleLoopAction_le_contractibleLoopAction_sub_integral`,\n `SmoothTwoForm.IsNondegenerate.contractibleLoopAction_le_contractibleLoopAction_of_monotone`: the\n action estimate along a Floer cylinder for an `s`-dependent perturbation, and its monotone case.\n* `IsNondegenerate.contractibleLoopAction_le_contractibleLoopAction_add_of_linearHomotopy`,\n `IsNondegenerate.contractibleLoopAction_le_contractibleLoopAction_add_of_continuationHomotopy`:\n the action shift along cylinders of a linear homotopy and of the continuation homotopy.\n\n## References\n\n* D. Salamon, *Lectures on Floer homology*, in *Symplectic geometry and topology*, IAS/Park City\n Math. Ser. 7 (1999), Lecture 1 (the energy identity for Floer cylinders, with the sign\n conventions used here).\n* D. McDuff and D. Salamon, *J-holomorphic Curves and Symplectic Topology*, 2nd ed., AMS, 2012,\n Section 8.1 and the chapter on Floer homology.\n* H. Hofer and D. A. Salamon, *Floer homology and Novikov rings*, in *The Floer memorial\n volume*, Progr. Math. 133 (1995), 483\u2013524, on the energy of Floer cylinders between capped\n orbits.\n* J.-F. Barraud, M. Damian, V. Humili\u00e8re, A. Oancea, *Floer homology with DG coefficients.\n Applications to cotangent bundles*, arXiv:2404.07953, \u00a73.2 and Corollaries 3.24 and 3.25.\n* A. Floer, *Symplectic fixed points and holomorphic spheres*, Comm. Math. Phys. 120 (1989),\n 575\u2013611, on the action and energy of strips through paths seamed by a symplectomorphism.\n* Y.-J. Lee, *Reidemeister torsion in Floer\u2013Novikov theory and counting pseudo-holomorphic tori,\n I*, J. Symplectic Geom. 3 (2005), 221\u2013311, \u00a73.1.\n-/\n\npublic noncomputable section\n\nopen Set MeasureTheory Function Real\nopen scoped Manifold Interval\n\nnamespace TauCeti.Floer\n\nvariable {E HM M : Type*} [NormedAddCommGroup E] [NormedSpace \u211d E] [TopologicalSpace HM]\n {I : ModelWithCorners \u211d E HM} [TopologicalSpace M] [ChartedSpace HM M]\n\n/-- The cylindrical family `(s, t) \u21a6 H_t` of a `C\u207f` time-dependent Hamiltonian on a manifold,\nindependent of `s`, is a `C\u207f` family of Hamiltonians. -/\ntheorem contMDiff_uncurry_comp_snd {n : \u2115\u221e} {H : \u211d \u2192 M \u2192 \u211d}\n (hH : ContMDiff (\ud835\udcd8(\u211d).prod I) \ud835\udcd8(\u211d) n (uncurry H)) :\n ContMDiff (\ud835\udcd8(\u211d, \u211d \u00d7 \u211d).prod I) \ud835\udcd8(\u211d) n (uncurry fun w : \u211d \u00d7 \u211d \u21a6 H w.2) :=\n hH.comp ((contDiff_snd.contMDiff.comp contMDiff_fst).prodMk contMDiff_snd)\n\n/-- The linear homotopy `H\u2080 + \u03b2(s) (H\u2081 - H\u2080)` of two `C\u207f` time-dependent Hamiltonians on a manifold\nwith a `C\u207f` profile `\u03b2` is a `C\u207f` family of Hamiltonians. -/\ntheorem contMDiff_uncurry_linearHomotopy {n : \u2115\u221e} {H\u2080 H\u2081 : \u211d \u2192 M \u2192 \u211d} {\u03b2 : \u211d \u2192 \u211d}\n (h\u03b2 : ContDiff \u211d n \u03b2) (hH\u2080 : ContMDiff (\ud835\udcd8(\u211d).prod I) \ud835\udcd8(\u211d) n (uncurry H\u2080))\n (hH\u2081 : ContMDiff (\ud835\udcd8(\u211d).prod I) \ud835\udcd8(\u211d) n (uncurry H\u2081)) :\n ContMDiff (\ud835\udcd8(\u211d, \u211d \u00d7 \u211d).prod I) \ud835\udcd8(\u211d) n (uncurry (linearHomotopy \u03b2 H\u2080 H\u2081)) := by\n have hs : ContMDiff (\ud835\udcd8(\u211d, \u211d \u00d7 \u211d).prod I) \ud835\udcd8(\u211d) n fun p : (\u211d \u00d7 \u211d) \u00d7 M \u21a6 \u03b2 p.1.1 :=\n (h\u03b2.comp contDiff_fst).contMDiff.comp contMDiff_fst\n exact ((contMDiff_uncurry_comp_snd hH\u2080).add (hs.smul ((contMDiff_uncurry_comp_snd hH\u2081).sub\n (contMDiff_uncurry_comp_snd hH\u2080)))).congr fun p \u21a6 linearHomotopy_def \u03b2 p.1 p.2\n\n/-- The reparametrization `(s, t) \u21a6 K_{(\u03b2(s), t)}` of a `C\u207f` family of Hamiltonians on a manifold by\na `C\u207f` function `\u03b2` is a `C\u207f` family of Hamiltonians. -/\ntheorem contMDiff_uncurry_reparam {n : \u2115\u221e} {K : \u211d \u00d7 \u211d \u2192 M \u2192 \u211d} {\u03b2 : \u211d \u2192 \u211d}\n (h\u03b2 : ContDiff \u211d n \u03b2) (hK : ContMDiff (\ud835\udcd8(\u211d, \u211d \u00d7 \u211d).prod I) \ud835\udcd8(\u211d) n (uncurry K)) :\n ContMDiff (\ud835\udcd8(\u211d, \u211d \u00d7 \u211d).prod I) \ud835\udcd8(\u211d) n (uncurry fun w : \u211d \u00d7 \u211d \u21a6 K (\u03b2 w.1, w.2)) :=\n hK.comp ((((h\u03b2.comp contDiff_fst).prodMk contDiff_snd).contMDiff.comp contMDiff_fst).prodMk\n contMDiff_snd)\n\n/-- **The integrated curvature of a homotopy along a map.** Let `G_z`, `z = (s, t)`, be a `C\u00b9`\nfamily of Hamiltonians on a manifold and `u` a `C\u00b9` map. If `-\u2202_s G(s, t, u(s, t)) \u2264 c(s)` on\n`[a, b] \u00d7 [0, 1]` for a function `c` integrable on `[a, b]`, then minus the integral of the\ncurvature `\u2202_s G` along `u` over the rectangle is at most `\u222b_a^b c`. -/\ntheorem neg_setIntegral_fderiv_le_setIntegral {G : \u211d \u00d7 \u211d \u2192 M \u2192 \u211d}\n (hG : ContMDiff (\ud835\udcd8(\u211d, \u211d \u00d7 \u211d).prod I) \ud835\udcd8(\u211d) 1 (uncurry G)) {u : \u211d \u00d7 \u211d \u2192 M}\n (hu : ContMDiff \ud835\udcd8(\u211d, \u211d \u00d7 \u211d) I 1 u) {a b : \u211d} {c : \u211d \u2192 \u211d} (hc : IntegrableOn c (Icc a b))\n (hGc : \u2200 z \u2208 Icc a b \u00d7\u02e2 Icc 0 1, -deriv (fun s \u21a6 G (s, z.2) (u z)) z.1 \u2264 c z.1) :\n -\u222b z in Icc a b \u00d7\u02e2 Icc 0 1, fderiv \u211d (fun w \u21a6 G w (u z)) z stdComplexLineReal \u2264\n \u222b s in Icc a b, c s := by\n have hcurv : Continuous fun z \u21a6 fderiv \u211d (fun w \u21a6 G w (u z)) z stdComplexLineReal :=\n (continuous_fderiv_of_contMDiff hu hG).clm_apply continuous_const\n -- On the rectangle, the restricted Lebesgue measure is the product of the restrictions.\n have hci : IntegrableOn (fun z : \u211d \u00d7 \u211d \u21a6 c z.1) (Icc a b \u00d7\u02e2 Icc 0 1) := by\n rw [IntegrableOn, Measure.volume_eq_prod, \u2190 Measure.prod_restrict]\n exact Integrable.comp_fst hc _\n have hle : \u222b z in Icc a b \u00d7\u02e2 Icc (0 : \u211d) 1,\n -fderiv \u211d (fun w \u21a6 G w (u z)) z stdComplexLineReal \u2264 \u222b z in Icc a b \u00d7\u02e2 Icc (0 : \u211d) 1, c z.1 :=\n setIntegral_mono_on hcurv.neg.integrableOn_Icc_prod_Icc hci\n (measurableSet_Icc.prod measurableSet_Icc) fun z hz \u21a6 by\n have hd : ContDiff \u211d 1 fun w \u21a6 G w (u z) :=\n contMDiff_iff_contDiff.mp (hG.comp (contMDiff_id.prodMk contMDiff_const))\n rw [stdComplexLineReal_eq,\n fderiv_apply_mk_one_zero (hd.differentiable one_ne_zero z)]\n exact hGc z hz\n have hrhs : \u222b z in Icc a b \u00d7\u02e2 Icc (0 : \u211d) 1, c z.1 = \u222b s in Icc a b, c s := by\n simpa using setIntegral_Icc_prod_comp_fst c zero_le_one\n rwa [integral_neg, hrhs] at hle\n\n/-- **The integrated curvature of a linear homotopy along a map.** Let `H\u2080` and `H\u2081` be `C\u00b9`\ntime-dependent Hamiltonians on a manifold, `\u03b2` a monotone `C\u00b9` profile and `u` a continuous map.\nIf `H\u2080 - H\u2081 \u2264 B` along `u` on `[a, b] \u00d7 [0, 1]` for a function `B` integrable on `[0, 1]`, then\nminus the integral of the `s`-derivative `\u2202_s H(u) = \u03b2'(s) (H\u2081 - H\u2080)(t, u)` of the linear homotopy\n`H = H\u2080 + \u03b2(s) (H\u2081 - H\u2080)` over the rectangle is at most `(\u03b2(b) - \u03b2(a)) \u222b\u2080\u00b9 B`. -/\ntheorem neg_setIntegral_fderiv_linearHomotopy_le {H\u2080 H\u2081 : \u211d \u2192 M \u2192 \u211d}\n (hH\u2080 : ContMDiff (\ud835\udcd8(\u211d).prod I) \ud835\udcd8(\u211d) 1 (uncurry H\u2080))\n (hH\u2081 : ContMDiff (\ud835\udcd8(\u211d).prod I) \ud835\udcd8(\u211d) 1 (uncurry H\u2081)) {\u03b2 : \u211d \u2192 \u211d} (h\u03b2 : ContDiff \u211d 1 \u03b2)\n (h\u03b2m : Monotone \u03b2) {u : \u211d \u00d7 \u211d \u2192 M} (hu : Continuous u) {a b : \u211d} (hab : a \u2264 b)\n {B : \u211d \u2192 \u211d} (hB : IntegrableOn B (Icc 0 1))\n (hHB : \u2200 z \u2208 Icc a b \u00d7\u02e2 Icc 0 1, H\u2080 z.2 (u z) - H\u2081 z.2 (u z) \u2264 B z.2) :\n -\u222b z in Icc a b \u00d7\u02e2 Icc 0 1, fderiv \u211d (fun w \u21a6 linearHomotopy \u03b2 H\u2080 H\u2081 w (u z)) z\n stdComplexLineReal \u2264\n (\u03b2 b - \u03b2 a) * \u222b t in Icc 0 1, B t := by\n have hd {K : \u211d \u2192 M \u2192 \u211d} (hK : ContMDiff (\ud835\udcd8(\u211d).prod I) \ud835\udcd8(\u211d) 1 (uncurry K)) (t : \u211d) (x : M) :\n DifferentiableAt \u211d (fun t \u21a6 K t x) t :=\n (contMDiff_iff_contDiff.mp (hK.comp (contMDiff_id.prodMk contMDiff_const))).differentiable\n one_ne_zero t\n have hcurv (z : \u211d \u00d7 \u211d) :\n fderiv \u211d (fun w \u21a6 linearHomotopy \u03b2 H\u2080 H\u2081 w (u z)) z stdComplexLineReal =\n deriv \u03b2 z.1 * (H\u2081 z.2 (u z) - H\u2080 z.2 (u z)) :=\n fderiv_linearHomotopy_stdComplexLineReal (hd hH\u2080 _ _) (hd hH\u2081 _ _)\n simp only [hcurv]\n have hp : Continuous fun z : \u211d \u00d7 \u211d \u21a6 (z.2, u z) := continuous_snd.prodMk hu\n have hle := neg_mul_setIntegral_le_setIntegral_deriv_mul\n (f := fun z \u21a6 H\u2081 z.2 (u z) - H\u2080 z.2 (u z)) h\u03b2 h\u03b2m hab\n ((hH\u2081.continuous.comp hp).sub (hH\u2080.continuous.comp hp)).continuousOn hB\n fun z hz \u21a6 by linarith [hHB z hz]\n linarith\n\nend TauCeti.Floer\n\nnamespace TauCeti.SmoothTwoForm\n\nvariable {E HM M : Type*} [NormedAddCommGroup E] [NormedSpace \u211d E] [TopologicalSpace HM]\n {I : ModelWithCorners \u211d E HM} [TopologicalSpace M] [ChartedSpace HM M]\n [IsManifold I (\u22a4 : \u2115\u221e) M]\n\nvariable {\u03c9 : SmoothTwoForm I M} {H : \u211d \u2192 M \u2192 \u211d} {G : \u211d \u00d7 \u211d \u2192 M \u2192 \u211d} {u : \u211d \u00d7 \u211d \u2192 M}\n {f : M \u2192 M}\n\n/-! ### The energy identity for perturbations without `ds` component -/\n\nsection Energy\n\nvariable [FiniteDimensional \u211d E]\n\n/-- **The energy identity for a perturbation without `ds` component.** Let `G_z`, `z = (s, t)`, be\na `C\u00b9` family of Hamiltonians and `u` a `C\u00b9` map, for a nondegenerate two-form on a\nfinite-dimensional manifold. For the perturbation `K = G_z dt`, the Floer energy of `u` over\n`[a, b] \u00d7 [0, 1]` is its symplectic area over the rectangle, plus the Hamiltonian term of the loop\nat `s = b` for `G(b, \u00b7)`, minus that of the loop at `s = a` for `G(a, \u00b7)`, minus the integral of the\ncurvature `\u2202_s G` along `u`. Neither periodicity of `u` in `t` nor closedness of the form is\nneeded. -/\ntheorem IsNondegenerate.integral_floerEnergyDensity_zero_left (h\u03c9 : \u03c9.IsNondegenerate)\n (hG : ContMDiff (\ud835\udcd8(\u211d, \u211d \u00d7 \u211d).prod I) \ud835\udcd8(\u211d) 1 (uncurry G)) (hu : ContMDiff \ud835\udcd8(\u211d, \u211d \u00d7 \u211d) I 1 u)\n {a b : \u211d} (hab : a \u2264 b) :\n \u222b z in Icc a b \u00d7\u02e2 Icc 0 1, \u03c9.floerEnergyDensity (fun _ _ \u21a6 0) G u z =\n rectangleIntegral \u03c9.val u (a, 0) (b, 1) + (\u222b t in 0..1, G (b, t) (u (b, t))) -\n (\u222b t in 0..1, G (a, t) (u (a, t))) -\n \u222b z in Icc a b \u00d7\u02e2 Icc 0 1, fderiv \u211d (fun w \u21a6 G w (u z)) z stdComplexLineReal := by\n have hR : Icc a b \u00d7\u02e2 Icc (0 : \u211d) 1 = Icc (a, 0) (b, 1) := Icc_prod_Icc _ _ _ _\n have hab' : ((a, 0) : \u211d \u00d7 \u211d) \u2264 (b, 1) := Prod.mk_le_mk.2 \u27e8hab, zero_le_one\u27e9\n have h\u03c9\u2080 : IsSmoothForm I 0 \u03c9.val := \u03c9.isSmoothForm.of_le (by simp)\n -- The symplectic area density is the integrand of the rectangle integral.\n let area : \u211d \u00d7 \u211d \u2192 \u211d := fun z \u21a6 SmoothBundleForm.eval\u2082 \u03c9 (u z)\n (mfderiv \ud835\udcd8(\u211d, \u211d \u00d7 \u211d) I u z stdComplexLineReal) (mfderiv \ud835\udcd8(\u211d, \u211d \u00d7 \u211d) I u z stdComplexLineImag)\n have harea_cont : Continuous area := continuous_eval\u2082_mfderiv \u03c9 hu\n -- The derivative term `d(K(u))` is continuous, since `K_t(u)` is `C\u00b9`.\n have hf : ContDiff \u211d 1 fun w \u21a6 G w (u w) :=\n contMDiff_iff_contDiff.mp (hG.comp (contMDiff_id.prodMk hu))\n have hdK : Continuous fun z \u21a6 fderiv \u211d (fun w \u21a6 G w (u w)) z stdComplexLineReal :=\n (hf.continuous_fderiv one_ne_zero).clm_apply continuous_const\n have hcurv : Continuous fun z \u21a6 fderiv \u211d (fun w \u21a6 G w (u z)) z stdComplexLineReal :=\n (continuous_fderiv_of_contMDiff hu hG).clm_apply continuous_const\n -- Pointwise, the energy density is the area density plus `d(K(u))` minus the curvature.\n have hpt (z : \u211d \u00d7 \u211d) : \u03c9.floerEnergyDensity (fun _ _ \u21a6 0) G u z =\n area z + fderiv \u211d (fun w \u21a6 G w (u w)) z stdComplexLineReal -\n fderiv \u211d (fun w \u21a6 G w (u z)) z stdComplexLineReal := by\n rw [h\u03c9.floerEnergyDensity_eq ((hu z).mdifferentiableAt one_ne_zero)\n (contMDiffAt_const.mdifferentiableAt one_ne_zero)\n ((hG _).mdifferentiableAt one_ne_zero), hamiltonianCurvature_zero_left]\n simp [area]\n have hE : Continuous (\u03c9.floerEnergyDensity (fun _ _ \u21a6 0) G u) :=\n ((harea_cont.add hdK).sub hcurv).congr fun z \u21a6 (hpt z).symm\n have h := h\u03c9.integral_floerEnergyDensity (Ks := fun _ _ \u21a6 0) (Kt := G) isOpen_univ\n hu.contMDiffOn contMDiffOn_const hG.contMDiffOn hab' (subset_univ _)\n (hE.continuousOn.integrableOn_compact isCompact_Icc)\n (by simpa only [hamiltonianCurvature_zero_left] using\n hcurv.continuousOn.integrableOn_compact isCompact_Icc)\n simp only [hamiltonianCurvature_zero_left, intervalIntegral.integral_zero] at h\n rw [hR, h, \u2190 h\u03c9\u2080.setIntegral_eq_rectangleIntegral hu hab']\n simp only [SmoothBundleForm.eval\u2082_apply, stdComplexLineReal_eq, stdComplexLineImag_eq]\n ring\n\n/-- **The energy identity for a cylindrical perturbation.** Let `H` be a `C\u00b9` time-dependent\nHamiltonian and `u` a `C\u00b9` map, for a nondegenerate two-form on a finite-dimensional manifold.\nFor the cylindrical perturbation `K = H_t dt`, the Floer energy of `u` over `[a, b] \u00d7 [0, 1]` is\nits symplectic area over the rectangle, plus the Hamiltonian term of the loop at `s = b`, minus\nthat of the loop at `s = a`. Neither periodicity of `u` in `t` nor closedness of the form is\nneeded. -/\ntheorem IsNondegenerate.integral_floerEnergyDensity_cylindrical (h\u03c9 : \u03c9.IsNondegenerate)\n (hH : ContMDiff (\ud835\udcd8(\u211d).prod I) \ud835\udcd8(\u211d) 1 (uncurry H)) (hu : ContMDiff \ud835\udcd8(\u211d, \u211d \u00d7 \u211d) I 1 u)\n {a b : \u211d} (hab : a \u2264 b) :\n \u222b z in Icc a b \u00d7\u02e2 Icc 0 1, \u03c9.floerEnergyDensity (fun _ _ \u21a6 0) (fun w \u21a6 H w.2) u z =\n rectangleIntegral \u03c9.val u (a, 0) (b, 1) + (\u222b t in 0..1, H t (u (b, t))) -\n \u222b t in 0..1, H t (u (a, t)) := by\n rw [h\u03c9.integral_floerEnergyDensity_zero_left (Floer.contMDiff_uncurry_comp_snd hH) hu hab]\n simp [fderiv_cylindrical_apply_stdComplexLineReal]\n\n/-- **The energy of a Floer cylinder for a perturbation without `ds` component, with caps.** Let\n`G_z`, `z = (s, t)`, be a `C\u00b9` family of Hamiltonians on a finite-dimensional manifold with a\nnondegenerate two-form, `u` a `C\u00b9` map, and `v` an arbitrary `C\u00b9` map with `v (0, \u00b7) = \u03b3_b`, where\n`\u03b3_b = u(b, \u00b7)`. Rescaling `[a, b]` to `[0, 1]` makes `u` a map `w` from `\u03b3_a = u(a, \u00b7)` to `\u03b3_b`,\nglued to `v` as `w # v` (`TauCeti.rectangleTrans`). For the perturbation `K = G_z dt` the Floer\nenergy of `u` over `[a, b] \u00d7 [0, 1]` is `A_{G(a, \u00b7)}(\u03b3_a, w # v) - A_{G(b, \u00b7)}(\u03b3_b, v)` minus the\nintegral of the curvature `\u2202_s G` along `u`, for the action `TauCeti.cylinderAction` of a loop\nmeasured against a map, the two actions being taken for the Hamiltonians at the two ends. When `v`\nis a cap of `\u03b3_b`, `w # v` is a cap of `\u03b3_a`. Neither weak exactness nor closedness of `\u03c9` is\nneeded. -/\ntheorem IsNondegenerate.integral_floerEnergyDensity_eq_cylinderAction_sub_sub_integral\n (h\u03c9 : \u03c9.IsNondegenerate) (hG : ContMDiff (\ud835\udcd8(\u211d, \u211d \u00d7 \u211d).prod I) \ud835\udcd8(\u211d) 1 (uncurry G))\n (hu : ContMDiff \ud835\udcd8(\u211d, \u211d \u00d7 \u211d) I 1 u) {a b : \u211d} (hab : a \u2264 b) {v : \u211d \u00d7 \u211d \u2192 M}\n (hv : ContMDiff \ud835\udcd8(\u211d, \u211d \u00d7 \u211d) I 1 v) (hv\u2080 : \u2200 t, v (0, t) = u (b, t)) :\n \u222b z in Icc a b \u00d7\u02e2 Icc 0 1, \u03c9.floerEnergyDensity (fun _ _ \u21a6 0) G u z =\n cylinderAction \u03c9.val (fun t \u21a6 G (a, t))\n (rectangleTrans (u \u2218 Prod.map (fun s \u21a6 a + (b - a) * s) id) v) -\n cylinderAction \u03c9.val (fun t \u21a6 G (b, t)) v -\n \u222b z in Icc a b \u00d7\u02e2 Icc 0 1, fderiv \u211d (fun w \u21a6 G w (u z)) z stdComplexLineReal := by\n have h\u03c9\u2080 : IsSmoothForm I 0 \u03c9.val := \u03c9.isSmoothForm.of_le (by simp)\n -- Rescale `[a, b]` to `[0, 1]` to view `u` as a cylinder from `\u03b3_a` to `\u03b3_b`.\n have hw := hu.comp (contMDiff_prodMap_affine (n := 1) a b)\n rw [h\u03c9.integral_floerEnergyDensity_zero_left hG hu hab,\n cylinderAction_rectangleTrans h\u03c9\u2080 _ hw hv fun t \u21a6 by simp [hv\u2080],\n cylinderAction_def, cylinderAction_def,\n rectangleIntegral_comp_prodMap_affine h\u03c9\u2080 hu a b 0 1]\n simp only [Function.comp_apply, Prod.map_apply, id_eq, mul_zero, add_zero, hv\u2080]\n ring\n\n/-- **The energy of a Floer cylinder is the drop of the capped action.** Let `\u03c9` be a\nnondegenerate two-form on a finite-dimensional manifold, `H` a `C\u00b9` time-dependent Hamiltonian\nand `u` a `C\u00b9` map. Let `v` be an arbitrary `C\u00b9` map with `v (0, \u00b7) = \u03b3_b`, where\n`\u03b3_b = u(b, \u00b7)`. Rescaling `[a, b]` to `[0, 1]` makes `u` a map `w` from `\u03b3_a = u(a, \u00b7)` to\n`\u03b3_b`, which is glued to `v` as `w # v` (`TauCeti.rectangleTrans`). The Floer energy of `u` over\n`[a, b] \u00d7 [0, 1]` for the cylindrical perturbation `K = H_t dt` is\n`A_H(\u03b3_a, w # v) - A_H(\u03b3_b, v)`, for the action `TauCeti.cylinderAction` of a loop measured\nagainst a map. When `v` is a cap of `\u03b3_b`, `w # v` is a cap of `\u03b3_a`, and this is the energy\nidentity for capped loops: the energy is the drop of the capped action. Neither weak exactness nor\nclosedness of `\u03c9` is needed, and neither `u` nor `v` needs to be periodic. -/\ntheorem IsNondegenerate.integral_floerEnergyDensity_eq_cylinderAction_sub\n (h\u03c9 : \u03c9.IsNondegenerate) (hH : ContMDiff (\ud835\udcd8(\u211d).prod I) \ud835\udcd8(\u211d) 1 (uncurry H))\n (hu : ContMDiff \ud835\udcd8(\u211d, \u211d \u00d7 \u211d) I 1 u) {a b : \u211d} (hab : a \u2264 b) {v : \u211d \u00d7 \u211d \u2192 M}\n (hv : ContMDiff \ud835\udcd8(\u211d, \u211d \u00d7 \u211d) I 1 v) (hv\u2080 : \u2200 t, v (0, t) = u (b, t)) :\n \u222b z in Icc a b \u00d7\u02e2 Icc 0 1, \u03c9.floerEnergyDensity (fun _ _ \u21a6 0) (fun w \u21a6 H w.2) u z =\n cylinderAction \u03c9.val H (rectangleTrans (u \u2218 Prod.map (fun s \u21a6 a + (b - a) * s) id) v) -\n cylinderAction \u03c9.val H v := by\n rw [h\u03c9.integral_floerEnergyDensity_eq_cylinderAction_sub_sub_integral\n (Floer.contMDiff_uncurry_comp_snd hH) hu hab hv hv\u2080]\n simp [fderiv_cylindrical_apply_stdComplexLineReal]\n\n", "statement": "/-- **The energy of a Floer cylinder for an `s`-dependent perturbation.** Let `\u03c9` be a\nnondegenerate weakly exact two-form on a finite-dimensional manifold, `G_z`, `z = (s, t)`, a `C\u00b9`\nfamily of Hamiltonians, and `u` a `C\u00b2` map, `1`-periodic in its second coordinate. If the loop\n`\u03b3_b = u(b, \u00b7)` bounds a cap, the Floer energy of `u` over `[a, b] \u00d7 [0, 1]` for the perturbation\n`K = G_z dt` is `A_{G(a, \u00b7)}(\u03b3_a) - A_{G(b, \u00b7)}(\u03b3_b)` minus the integral of `\u2202_s G` along `u`,\nwhere `\u03b3_a = u(a, \u00b7)` and `A` is the action `TauCeti.contractibleLoopAction` of contractible\nloops. The loop `\u03b3_a` is capped by gluing `u` to the cap of `\u03b3_b`. -/\ntheorem IsNondegenerate.integral_floerEnergyDensity_eq_contractibleLoopAction_sub_sub_integral\n (h\u03c9 : \u03c9.IsNondegenerate) (h\u03c9e : IsWeaklyExact \u03c9.val)\n (hG : ContMDiff (\ud835\udcd8(\u211d, \u211d \u00d7 \u211d).prod I) \ud835\udcd8(\u211d) 1 (uncurry G)) (hu : ContMDiff \ud835\udcd8(\u211d, \u211d \u00d7 \u211d) I 2 u)\n (hper : \u2200 z : \u211d \u00d7 \u211d, u (z.1, z.2 + 1) = u z) {a b : \u211d} (hab : a \u2264 b) {v : \u211d \u00d7 \u211d \u2192 M}\n (hv : IsCap I v fun t \u21a6 u (b, t)) :\n \u222b z in Icc a b \u00d7\u02e2 Icc 0 1, \u03c9.floerEnergyDensity (fun _ _ \u21a6 0) G u z =\n contractibleLoopAction \u03c9.val (fun t \u21a6 G (a, t)) (fun t \u21a6 u (a, t)) -\n contractibleLoopAction \u03c9.val (fun t \u21a6 G (b, t)) (fun t \u21a6 u (b, t)) -\n \u222b z in Icc a b \u00d7\u02e2 Icc 0 1, fderiv \u211d (fun w \u21a6 G w (u z)) z stdComplexLineReal ", "proof": " by\n have h\u03c9\u2080 : IsSmoothForm I 0 \u03c9.val := \u03c9.isSmoothForm.of_le (by simp)\n -- Rescale `[a, b]` to `[0, 1]` to view `u` as a cylinder from `\u03b3_a` to `\u03b3_b`.\n let \u03c3 : \u211d \u2192 \u211d := fun s \u21a6 a + (b - a) * s\n have h\u03c3 (s : \u211d) : HasDerivAt \u03c3 (b - a) s := by\n have h := ((hasDerivAt_id s).const_mul (b - a)).const_add a\n rwa [mul_one] at h\n have hw : IsLoopCylinder I (u \u2218 Prod.map \u03c3 id) (fun t \u21a6 u (a, t)) fun t \u21a6 u (b, t) :=\n { contMDiff := hu.comp\n (((contDiff_const.add (contDiff_const.mul contDiff_id)).prodMap contDiff_id).contMDiff)\n apply_add_one := fun z \u21a6 hper (\u03c3 z.1, z.2)\n apply_zero := fun t \u21a6 by simp [\u03c3]\n apply_one := fun t \u21a6 by simp [\u03c3] }\n have hrect : rectangleIntegral \u03c9.val (u \u2218 Prod.map \u03c3 id) (0, 0) (1, 1) =\n rectangleIntegral \u03c9.val u (a, 0) (b, 1) := by\n rw [rectangleIntegral_comp_prodMap h\u03c9\u2080 (hu.of_le one_le_two) (fun s _ \u21a6 h\u03c3 s)\n continuousOn_const]\n simp [\u03c3]\n rw [h\u03c9.integral_floerEnergyDensity_zero_left hG (hu.of_le one_le_two) hab,\n contractibleLoopAction_def, contractibleLoopAction_def,\n h\u03c9e.capArea_eq_rectangleIntegral_add h\u03c9\u2080 hw hv, hrect]\n ring", "proof_lines": 21, "proof_length": 963, "rev": "75c8aed5fea63047615a25a9763fd5b68a86e891", "heartbeats": 2988, "image": "lean-compression:tauceti-75c8aed5fe-a608030cfc", "split": "dev"} {"path": "TauCeti/Dynamics/Billiard/Measure.lean", "module": "TauCeti.Dynamics.Billiard.Measure", "theorem": "TauCeti.StrictConvexBilliardTable.measurePreserving_nextCollisionEquiv", "prefix": "/-\nCopyright (c) 2026 The Tau Ceti contributors. All rights reserved.\nReleased under Apache 2.0 license as described in the file LICENSE.\nAuthors: The Tau Ceti contributors\n-/\nmodule\n\npublic import Mathlib.Dynamics.Ergodic.Conservative\npublic import Mathlib.MeasureTheory.Integral.IntervalIntegral.Periodic\npublic import TauCeti.Dynamics.Billiard.GeneratingFunction\npublic import TauCeti.Dynamics.Billiard.Inverse\nimport Mathlib.Analysis.Calculus.Deriv.Prod\nimport Mathlib.Analysis.InnerProductSpace.Calculus\nimport Mathlib.MeasureTheory.Function.Jacobian\nimport Mathlib.MeasureTheory.Function.SpecialFunctions.Inner\nimport TauCeti.LinearAlgebra.Determinant.Prod\nimport TauCeti.MeasureTheory.Integral.IntervalIntegral.Periodic\nimport TauCeti.MeasureTheory.Measure.Subtype\n\n/-!\n# The billiard map preserves area, and Poincar\u00e9 recurrence for billiards\n\nLet `\u03c7` be an arclength parametrization of the boundary of a strictly convex billiard table\n(`TauCeti.StrictConvexBilliardTable`), with period `L`, and let `B(s, v) = (t, w)` be its\nnext-collision map on the strip `\u211d \u00d7 (-1, 1)`. When `\u03c7` is twice differentiable, `B` preserves\nLebesgue measure `ds dv` on the strip\n(`TauCeti.StrictConvexBilliardTable.measurePreserving_nextCollisionEquiv`), and the billiard map\n`\u03b2` on the space of collision states `AddCircle L \u00d7 (-1, 1)` preserves the product of the Haar\nmeasure of the circle with Lebesgue measure, a finite measure of total mass `2 L`\n(`TauCeti.StrictConvexBilliardTable.measurePreserving_billiardMap`).\n\nThe proof reads the area form `ds \u2227 dv` in the chord coordinates `(s, t)`, `s < t < s + L`, given by\nthe generating function `S(s, t) = -\u2016\u03c7(t) - \u03c7(s)\u2016`. The maps\n\n`(s, t) \u21a6 (s, v) = (s, \u2202_s S(s, t))`, `(s, t) \u21a6 (t, w) = (t, -\u2202_t S(s, t))`\n\nsend a chord to its initial and final collision states, and `B` carries the first to the second.\nBoth are injective and differentiable on the window `s < t < s + L`, and their Jacobian\ndeterminants are the same mixed partial derivative `\u2202_t \u2202_s S = \u2202_s \u2202_t S` of the generating\nfunction (`TauCeti.StrictConvexBilliardTable.hasDerivAt_deriv_generatingFunction_left`,\n`TauCeti.StrictConvexBilliardTable.hasDerivAt_deriv_generatingFunction_right`). By the change of\nvariables formula both maps therefore send a set of chords to sets of states of the same area,\nand `B` preserves area. This is the measure-theoretic form of `B^*(dv \u2227 ds) = dv \u2227 ds`, read\noff from `dv \u2227 ds = \u2202_t \u2202_s S dt \u2227 ds = dw \u2227 dt`. Measurability of `B` comes from the\nLusin\u2013Souslin theorem, through `measurable_image_of_fderivWithin`, so no continuity of `B` is\nneeded. The billiard map is induced by `B` on the quotient by the deck translation\n`\u03c4(s, v) = (s + L, v)`, which `B` commutes with, so it preserves the quotient measure\n(`AddCircle.measurePreserving_of_lift`).\n\nA self-map preserving a finite measure is conservative\n(`MeasureTheory.MeasurePreserving.conservative`), and the product measure on\n`AddCircle L \u00d7 (-1, 1)` charges every nonempty open set. Hence\n**Poincar\u00e9 recurrence** holds for convex billiards: every nonempty open set of collision states\ncontains a state that returns to it\n(`TauCeti.StrictConvexBilliardTable.exists_mem_iterate_billiardMap_mem`), and almost every state\nreturns infinitely often to each of its neighbourhoods\n(`TauCeti.StrictConvexBilliardTable.ae_frequently_iterate_billiardMap_mem`).\n\n## Main results\n\n* `TauCeti.StrictConvexBilliardTable.measurePreserving_nextCollisionEquiv`: the next-collision\n map preserves Lebesgue measure on the strip.\n* `TauCeti.StrictConvexBilliardTable.measurePreserving_billiardMap`: the billiard map preserves\n the finite product measure on `AddCircle L \u00d7 (-1, 1)`.\n* `TauCeti.StrictConvexBilliardTable.exists_mem_iterate_billiardMap_mem`,\n `TauCeti.StrictConvexBilliardTable.ae_frequently_iterate_billiardMap_mem`: Poincar\u00e9 recurrence.\n\n## References\n\n* Ana Cannas da Silva, *Lectures on Symplectic Geometry*, Lecture Notes in Mathematics 1764,\n Springer, 2001, Section 5.2 (the billiard map preserves area, and Poincar\u00e9 recurrence).\n* Serge Tabachnikov, *Geometry and Billiards*, Student Mathematical Library 30, American\n Mathematical Society, 2005, Chapter 3 (the invariant area form of the billiard map).\n-/\n\npublic section\n\nnoncomputable section\n\nopen Function MeasureTheory Set Filter Topology Module\nopen scoped RealInnerProductSpace\n\nnamespace TauCeti\n\nattribute [local instance] FiniteDimensional.of_fact_finrank_eq_two\n\nvariable {E : Type*} [NormedAddCommGroup E] [InnerProductSpace \u211d E] [Fact (finrank \u211d E = 2)]\n\nnamespace StrictConvexBilliardTable\n\nvariable {o : Orientation \u211d E (Fin 2)} (\u03c7 : StrictConvexBilliardTable o)\n\n/-! ### Chord coordinates -/\n\n/-- The window `{(s, t) | s < t < s + L}` of chords from `\u03c7(s)` to `\u03c7(t)`. -/\nprivate def window : Set (\u211d \u00d7 \u211d) :=\n {p | p.2 \u2208 Ioo p.1 (p.1 + \u03c7.period)}\n\n/-- The state `(s, v)` at `\u03c7(s)` leaving along the chord to `\u03c7(t)`: `v = \u2202_s S(s, t)`. -/\nprivate def chordStart (p : \u211d \u00d7 \u211d) : \u211d \u00d7 \u211d :=\n (p.1, \u27eaderiv \u03c7 p.1, \u03c7.chordDir p.1 p.2\u27eb)\n\n/-- The state `(t, w)` at `\u03c7(t)` after arriving along the chord from `\u03c7(s)`:\n`w = -\u2202_t S(s, t)`. -/\nprivate def chordEnd (p : \u211d \u00d7 \u211d) : \u211d \u00d7 \u211d :=\n (p.2, \u27eaderiv \u03c7 p.2, \u03c7.chordDir p.1 p.2\u27eb)\n\n/-- The chord from `\u03c7(s)` to the next collision point of the state `(s, v)` starts at `(s, v)`. -/\nprivate theorem chordStart_nextParam {s v : \u211d} (hv : v \u2208 Ioo (-1) 1) :\n \u03c7.chordStart (s, \u03c7.nextParam s v) = (s, v) := by\n simp [chordStart, \u03c7.inner_deriv_chordDir_nextParam hv]\n\n/-- The next-collision map sends the initial state of a chord to its final state. -/\nprivate theorem nextCollision_chordStart {p : \u211d \u00d7 \u211d} (hp : p \u2208 \u03c7.window) :\n \u03c7.nextCollision (\u03c7.chordStart p) = \u03c7.chordEnd p := by\n have hv := \u03c7.inner_deriv_chordDir_mem_Ioo p.1 p.2\n have ht : \u03c7.nextParam p.1 \u27eaderiv \u03c7 p.1, \u03c7.chordDir p.1 p.2\u27eb = p.2 :=\n \u03c7.nextParam_inner_deriv_chordDir hp\n have hu := \u03c7.chordDir_nextParam (s := p.1) hv\n rw [ht] at hu\n simp only [nextCollision_apply, chordStart, chordEnd, nextTangential_def, ht, \u2190 hu,\n real_inner_comm]\n\nprivate theorem measurable_chordEnd : Measurable \u03c7.chordEnd := by\n borelize E\n have hd : Measurable fun p : \u211d \u00d7 \u211d \u21a6 \u03c7 p.2 - \u03c7 p.1 :=\n ((\u03c7.continuous.comp continuous_snd).sub (\u03c7.continuous.comp continuous_fst)).measurable\n have hu : Measurable fun p : \u211d \u00d7 \u211d \u21a6 \u03c7.chordDir p.1 p.2 := by\n simp only [chordDir_eq_inv_norm_smul]\n exact hd.norm.inv.smul hd\n have : CompleteSpace E := FiniteDimensional.completeSpace \u211d E\n exact measurable_snd.prodMk (Measurable.inner ((measurable_deriv \u03c7).comp measurable_snd) hu)\n\nprivate theorem isOpen_window : IsOpen \u03c7.window :=\n (isOpen_lt continuous_fst continuous_snd).inter\n (isOpen_lt continuous_snd (continuous_fst.add continuous_const))\n\nprivate theorem chordStart_mem_strip (p : \u211d \u00d7 \u211d) : \u03c7.chordStart p \u2208 univ \u00d7\u02e2 Ioo (-1 : \u211d) 1 :=\n \u27e8mem_univ _, \u03c7.inner_deriv_chordDir_mem_Ioo p.1 p.2\u27e9\n\nprivate theorem injOn_chordStart : InjOn \u03c7.chordStart \u03c7.window := by\n intro p hp q hq h\n obtain \u27e8h1, h2\u27e9 := Prod.ext_iff.1 h\n refine Prod.ext h1 ?_\n rw [\u2190 \u03c7.nextParam_inner_deriv_chordDir hp, \u2190 \u03c7.nextParam_inner_deriv_chordDir hq]\n exact congrArg\u2082 \u03c7.nextParam h1 h2\n\nprivate theorem injOn_chordEnd : InjOn \u03c7.chordEnd \u03c7.window := by\n intro p hp q hq h\n rw [\u2190 \u03c7.nextCollision_chordStart hp, \u2190 \u03c7.nextCollision_chordStart hq] at h\n exact \u03c7.injOn_chordStart hp hq\n (\u03c7.injOn_nextCollision (\u03c7.chordStart_mem_strip p) (\u03c7.chordStart_mem_strip q) h)\n\n/-- The twist `\u2202_t \u2202_s S = \u2202_s \u2202_t S` of the generating function at the chord `p`. -/\nprivate def twist (p : \u211d \u00d7 \u211d) : \u211d :=\n \u2016\u03c7 p.2 - \u03c7 p.1\u2016\u207b\u00b9 * (o.areaForm (deriv \u03c7 p.1) (\u03c7.chordDir p.1 p.2) *\n o.areaForm (deriv \u03c7 p.2) (\u03c7.chordDir p.1 p.2))\n\n/-- The initial state map is differentiable on the window, with Jacobian determinant the twist. -/\nprivate theorem exists_hasFDerivAt_chordStart (h\u03c7 : Differentiable \u211d (deriv \u03c7)) {p : \u211d \u00d7 \u211d}\n (hp : p \u2208 \u03c7.window) :\n \u2203 L : \u211d \u00d7 \u211d \u2192L[\u211d] \u211d \u00d7 \u211d, HasFDerivAt \u03c7.chordStart L p \u2227 L.det = \u03c7.twist p := by\n have h := \u03c7.apply_ne_of_mem_Ioo hp\n set g : \u211d \u00d7 \u211d \u2192 \u211d := fun q \u21a6 \u27eaderiv \u03c7 q.1, \u03c7.chordDir q.1 q.2\u27eb\n have hg : HasFDerivAt g (fderiv \u211d g p) p :=\n (((h\u03c7 p.1).comp p differentiableAt_fst).inner \u211d (\u03c7.differentiableAt_chordDir h)).hasFDerivAt\n refine \u27e8(ContinuousLinearMap.fst \u211d \u211d \u211d).prod (fderiv \u211d g p), hasFDerivAt_fst.prodMk hg, ?_\u27e9\n -- The derivative along `(0, 1)` is the partial derivative `\u2202_t \u2202_s S`.\n have ht : HasDerivAt (fun t \u21a6 g (p.1, t)) (fderiv \u211d g p (0, 1)) p.2 :=\n hg.comp_hasDerivAt_of_eq p.2 (HasDerivAt.prodMk (hasDerivAt_const _ _) (hasDerivAt_id _)) rfl\n have ht' : HasDerivAt (fun t \u21a6 g (p.1, t)) (\u03c7.twist p) p.2 :=\n (\u03c7.hasDerivAt_deriv_generatingFunction_left h).congr_of_eventuallyEq\n (by filter_upwards [\u03c7.continuous.continuousAt.eventually_ne h] with t' ht'\n exact ((\u03c7.hasDerivAt_generatingFunction_left ht').deriv).symm)\n rw [ContinuousLinearMap.det, LinearMap.det_finTwoProd]\n simp [ht.unique ht']\n\n/-- The final state map is differentiable on the window, with Jacobian determinant the twist. -/\nprivate theorem exists_hasFDerivAt_chordEnd (h\u03c7 : Differentiable \u211d (deriv \u03c7)) {p : \u211d \u00d7 \u211d}\n (hp : p \u2208 \u03c7.window) :\n \u2203 L : \u211d \u00d7 \u211d \u2192L[\u211d] \u211d \u00d7 \u211d, HasFDerivAt \u03c7.chordEnd L p \u2227 L.det = \u03c7.twist p := by\n have h := \u03c7.apply_ne_of_mem_Ioo hp\n set g : \u211d \u00d7 \u211d \u2192 \u211d := fun q \u21a6 \u27eaderiv \u03c7 q.2, \u03c7.chordDir q.1 q.2\u27eb\n have hg : HasFDerivAt g (fderiv \u211d g p) p :=\n (((h\u03c7 p.2).comp p differentiableAt_snd).inner \u211d (\u03c7.differentiableAt_chordDir h)).hasFDerivAt\n refine \u27e8(ContinuousLinearMap.snd \u211d \u211d \u211d).prod (fderiv \u211d g p), hasFDerivAt_snd.prodMk hg, ?_\u27e9\n -- The derivative along `(1, 0)` is minus the partial derivative `\u2202_s \u2202_t S`.\n have hs : HasDerivAt (fun s \u21a6 g (s, p.2)) (fderiv \u211d g p (1, 0)) p.1 :=\n hg.comp_hasDerivAt_of_eq p.1 (HasDerivAt.prodMk (hasDerivAt_id _) (hasDerivAt_const _ _)) rfl\n have hs' : HasDerivAt (fun s \u21a6 g (s, p.2)) (-\u03c7.twist p) p.1 :=\n (\u03c7.hasDerivAt_deriv_generatingFunction_right h).neg.congr_of_eventuallyEq\n (by filter_upwards [\u03c7.continuous.continuousAt.eventually_ne h.symm] with s' hs'\n rw [Pi.neg_apply, (\u03c7.hasDerivAt_generatingFunction_right hs'.symm).deriv, neg_neg])\n rw [ContinuousLinearMap.det, LinearMap.det_finTwoProd]\n simp [hs.unique hs']\n\n/-- The initial and final state maps send every measurable set of chords to sets of states of the\nsame area, since their Jacobian determinants agree. -/\nprivate theorem volume_image_chordStart (h\u03c7 : Differentiable \u211d (deriv \u03c7)) {K : Set (\u211d \u00d7 \u211d)}\n (hK : MeasurableSet K) (hKw : K \u2286 \u03c7.window) :\n volume (\u03c7.chordStart '' K) = volume (\u03c7.chordEnd '' K) := by\n have : (volume : Measure (\u211d \u00d7 \u211d)).IsAddHaarMeasure := by\n rw [Measure.volume_eq_prod]\n infer_instance\n choose! L\u2081 hL\u2081 hdet\u2081 using fun p (hp : p \u2208 \u03c7.window) \u21a6 \u03c7.exists_hasFDerivAt_chordStart h\u03c7 hp\n choose! L\u2082 hL\u2082 hdet\u2082 using fun p (hp : p \u2208 \u03c7.window) \u21a6 \u03c7.exists_hasFDerivAt_chordEnd h\u03c7 hp\n rw [\u2190 lintegral_abs_det_fderiv_eq_addHaar_image volume hK\n (fun p hp \u21a6 (hL\u2081 p (hKw hp)).hasFDerivWithinAt) (\u03c7.injOn_chordStart.mono hKw),\n \u2190 lintegral_abs_det_fderiv_eq_addHaar_image volume hK\n (fun p hp \u21a6 (hL\u2082 p (hKw hp)).hasFDerivWithinAt) (\u03c7.injOn_chordEnd.mono hKw)]\n exact setLIntegral_congr_fun hK fun p hp \u21a6 by rw [hdet\u2081 p (hKw hp), hdet\u2082 p (hKw hp)]\n\n/-! ### The next-collision map preserves area -/\n\n/-- The inclusion of the strip `\u211d \u00d7 (-1, 1)` in the plane. -/\nprivate def stripIncl (x : \u211d \u00d7 Ioo (-1 : \u211d) 1) : \u211d \u00d7 \u211d :=\n (x.1, x.2)\n\n@[simp]\nprivate theorem stripIncl_apply (x : \u211d \u00d7 Ioo (-1 : \u211d) 1) : stripIncl x = (x.1, (x.2 : \u211d)) :=\n rfl\n\nprivate theorem stripIncl_eq_prodMap : stripIncl = Prod.map id ((\u2191) : Ioo (-1 : \u211d) 1 \u2192 \u211d) :=\n rfl\n\nprivate theorem measurableEmbedding_stripIncl : MeasurableEmbedding stripIncl := by\n rw [stripIncl_eq_prodMap]\n exact MeasurableEmbedding.id.prodMap (MeasurableEmbedding.subtypeVal measurableSet_Ioo)\n\n/-- The inclusion of the strip carries its measure to Lebesgue measure. -/\nprivate theorem volume_image_stripIncl (A : Set (\u211d \u00d7 Ioo (-1 : \u211d) 1)) :\n volume (stripIncl '' A) = (volume.prod (volume.comap Subtype.val)) A := by\n have hS : MeasurableSet ((univ : Set \u211d) \u00d7\u02e2 Ioo (-1 : \u211d) 1) :=\n MeasurableSet.univ.prod measurableSet_Ioo\n have hmp : MeasurePreserving stripIncl (volume.prod (volume.comap Subtype.val))\n (volume.restrict (univ \u00d7\u02e2 Ioo (-1 : \u211d) 1)) := by\n rw [stripIncl_eq_prodMap, Measure.volume_eq_prod]\n exact measurePreserving_prodMap_subtype_coe _ _ measurableSet_Ioo\n conv_rhs => rw [\u2190 measurableEmbedding_stripIncl.injective.preimage_image A]\n rw [hmp.measure_preimage_emb measurableEmbedding_stripIncl, Measure.restrict_apply' hS,\n inter_eq_left.2]\n rintro _ \u27e8x, -, rfl\u27e9\n exact \u27e8mem_univ _, x.2.property\u27e9\n\nprivate theorem stripIncl_nextCollisionEquiv (x : \u211d \u00d7 Ioo (-1 : \u211d) 1) :\n stripIncl (\u03c7.nextCollisionEquiv x) = \u03c7.nextCollision (stripIncl x) := by\n simp [nextCollision_apply]\n\n/-- The state `x` of the strip is the initial state of its chord. -/\nprivate theorem chordStart_eq_stripIncl (x : \u211d \u00d7 Ioo (-1 : \u211d) 1) :\n \u03c7.chordStart (x.1, \u03c7.nextParam x.1 x.2) = stripIncl x := by\n rw [stripIncl_apply]\n exact \u03c7.chordStart_nextParam x.2.property\n\nprivate theorem stripIncl_mem_image_chordEnd (x : \u211d \u00d7 Ioo (-1 : \u211d) 1) :\n stripIncl x \u2208 \u03c7.chordEnd '' \u03c7.window := by\n set z := \u03c7.nextCollisionEquiv.symm x\n refine \u27e8(z.1, \u03c7.nextParam z.1 z.2), \u03c7.nextParam_mem_Ioo (s := z.1) z.2.property, ?_\u27e9\n rw [\u2190 \u03c7.nextCollision_chordStart (\u03c7.nextParam_mem_Ioo (s := z.1) z.2.property),\n chordStart_eq_stripIncl, \u2190 stripIncl_nextCollisionEquiv, Equiv.apply_symm_apply]\n\n/-- Preimages under the next-collision map, read in chord coordinates: a state lies in the\npreimage of `A` exactly when it is the initial state of a chord whose final state lies in `A`. -/\nprivate theorem image_preimage_nextCollisionEquiv (A : Set (\u211d \u00d7 Ioo (-1 : \u211d) 1)) :\n stripIncl '' (\u03c7.nextCollisionEquiv \u207b\u00b9' A) =\n \u03c7.chordStart '' (\u03c7.window \u2229 \u03c7.chordEnd \u207b\u00b9' (stripIncl '' A)) := by\n ext y\n constructor\n \u00b7 rintro \u27e8x, hx, rfl\u27e9\n have hp := \u03c7.nextParam_mem_Ioo (s := x.1) x.2.property\n refine \u27e8(x.1, \u03c7.nextParam x.1 x.2), \u27e8hp, ?_\u27e9, \u03c7.chordStart_eq_stripIncl x\u27e9\n rw [mem_preimage, \u2190 \u03c7.nextCollision_chordStart hp, chordStart_eq_stripIncl,\n \u2190 stripIncl_nextCollisionEquiv]\n exact mem_image_of_mem _ hx\n \u00b7 rintro \u27e8p, \u27e8hp, a, ha, hpa\u27e9, rfl\u27e9\n refine \u27e8(p.1, \u27e8_, \u03c7.inner_deriv_chordDir_mem_Ioo p.1 p.2\u27e9), ?_, by simp [chordStart]\u27e9\n have : \u03c7.nextCollisionEquiv (p.1, \u27e8_, \u03c7.inner_deriv_chordDir_mem_Ioo p.1 p.2\u27e9) = a := by\n refine measurableEmbedding_stripIncl.injective ?_\n rw [hpa, stripIncl_nextCollisionEquiv, \u2190 \u03c7.nextCollision_chordStart hp]\n simp [chordStart]\n rw [mem_preimage, this]\n exact ha\n\nprivate theorem measurableSet_window_inter (A : Set (\u211d \u00d7 Ioo (-1 : \u211d) 1)) (hA : MeasurableSet A) :\n MeasurableSet (\u03c7.window \u2229 \u03c7.chordEnd \u207b\u00b9' (stripIncl '' A)) :=\n \u03c7.isOpen_window.measurableSet.inter\n (\u03c7.measurable_chordEnd (measurableEmbedding_stripIncl.measurableSet_image.2 hA))\n\nvariable {\u03c7}\n\n", "statement": "/-- **The next-collision map preserves area.** If the arclength parametrization `\u03c7` is twice\ndifferentiable, the next-collision map `B(s, v) = (t, w)` preserves Lebesgue measure `ds dv` on the\nstrip `\u211d \u00d7 (-1, 1)`. -/\ntheorem measurePreserving_nextCollisionEquiv (h\u03c7 : Differentiable \u211d (deriv \u03c7)) :\n MeasurePreserving \u03c7.nextCollisionEquiv (volume.prod (volume.comap Subtype.val))\n (volume.prod (volume.comap Subtype.val)) ", "proof": " by\n choose! L hL _ using fun p (hp : p \u2208 \u03c7.window) \u21a6 \u03c7.exists_hasFDerivAt_chordStart h\u03c7 hp\n have hmeas : Measurable \u03c7.nextCollisionEquiv := fun A hA \u21a6 by\n rw [\u2190 measurableEmbedding_stripIncl.measurableSet_image, image_preimage_nextCollisionEquiv]\n exact measurable_image_of_fderivWithin (\u03c7.measurableSet_window_inter A hA)\n (fun p hp \u21a6 (hL p hp.1).hasFDerivWithinAt) (\u03c7.injOn_chordStart.mono inter_subset_left)\n refine \u27e8hmeas, Measure.ext fun A hA \u21a6 ?_\u27e9\n rw [Measure.map_apply hmeas hA, \u2190 volume_image_stripIncl, image_preimage_nextCollisionEquiv,\n \u03c7.volume_image_chordStart h\u03c7 (\u03c7.measurableSet_window_inter A hA) inter_subset_left,\n image_inter_preimage, inter_eq_right.2, volume_image_stripIncl]\n rintro _ \u27e8x, -, rfl\u27e9\n exact \u03c7.stripIncl_mem_image_chordEnd x", "proof_lines": 11, "proof_length": 748, "rev": "75c8aed5fea63047615a25a9763fd5b68a86e891", "heartbeats": 703, "image": "lean-compression:tauceti-75c8aed5fe-a608030cfc", "split": "dev"} {"path": "TauCeti/Geometry/Symplectic/Floer/Trajectory/Compactness.lean", "module": "TauCeti.Geometry.Symplectic.Floer.Trajectory.Compactness", "theorem": "TauCeti.SymplecticForm.exists_pos_forall_tendstoLocallyUniformlyOn_subseq_off_finset_of_periodic", "prefix": "/-\nCopyright (c) 2026 The Tau Ceti contributors. All rights reserved.\nReleased under Apache 2.0 license as described in the file LICENSE.\nAuthors: The Tau Ceti contributors\n-/\nmodule\n\npublic import TauCeti.Geometry.Symplectic.Floer.Compactness.Basic\nimport TauCeti.MeasureTheory.Group.Integral\nimport TauCeti.MeasureTheory.Group.Measure\nimport TauCeti.MeasureTheory.Integral.Bochner.PeriodicStrip\nimport TauCeti.MeasureTheory.Measure.BubblingSet\n\n/-!\n# Compactness of Floer trajectories off finitely many bubbling points\n\nA Floer trajectory is a map from the cylinder `\u211d \u00d7 S\u00b9` to `V`, which we write as a map\n`u : \u211d \u00d7 \u211d \u2192 V` that is `1`-periodic in `t`, solving the Floer equation\n`\u2202\u209bu + J_t(u) (\u2202\u209cu - X_{H_t}(u)) = 0` for the cylindrical perturbation `K = H_t dt` and almost\ncomplex structures `J_t`, both `1`-periodic in `t`. Its energy is the integral of the Floer energy\ndensity over the fundamental strip `\u211d \u00d7 [0, 1)`. Such cylinders are counted by the Floer\ndifferential, and they break off at the ends of a pair of pants. The compactness theorem\n`TauCeti.SymplecticForm.exists_pos_forall_tendstoLocallyUniformlyOn_subseq_off_finset` applies on\none compact window `D` of the domain, with an energy threshold `\u03b4` depending on `D`. Applying it on\nlarger and larger windows gives thresholds that may tend to `0`, and hence no bound on the number of\nbubbling points over the whole cylinder. This file proves compactness on the whole cylinder with a\nsingle threshold, for data invariant under the translations of the domain by the integer points\n`(m, n)`. The data of a Floer trajectory are such: they do not depend on `s` and are `1`-periodic\nin `t`.\n\nThe translate `z \u21a6 u(z + (m, n))` of a solution solves the same equation\n(`TauCeti.SymplecticForm.perturbedFDeriv_comp_add_right`), and its energy over the unit disc is at\nmost twice the energy over the strip (`TauCeti.setIntegral_ball_le_two_mul_of_periodic`), so the\nthreshold of the closed unit disc serves for each of its integer translates, and the open unit\ndiscs about the integer points cover the plane. These windows are assembled into one statement on\nthe cylinder by `TauCeti.exists_tendstoLocallyUniformlyOn_subseq_off_finset_of_periodic`: a\ndiagonal subsequence converges on each of the countably many discs off finitely many bubbling\npoints, the set of points at which Floer energy at least `\u03b4` concentrates is invariant under the\nperiod `(0, 1)`, so it is determined by its points in the fundamental strip, and there are at most\n`2E / \u03b4` of them, so the theorems state the threshold `\u03b4 / 2`. Off their translates the limit is\nthe pointwise limit, which is again `1`-periodic in `t`.\n\n`TauCeti.Geometry.Symplectic.Floer.Trajectory.Compactness.Closed` proves the same for a closed\nmanifold target.\n\nThe two results, in the namespace `TauCeti.SymplecticForm`, are:\n\n* `exists_pos_forall_tendstoLocallyUniformlyOn_subseq_off_finset_of_periodic`: compactness off\n finitely many bubbling points on the cylinder, for data invariant under integer translations.\n* `exists_pos_forall_tendstoLocallyUniformlyOn_subseq_off_finset_translates_cylindrical`: the case\n of Floer trajectories, `K = H_t dt` with `J_t` depending on `t` only.\n\nFor a single compact window of height at most one, the compactness of Floer cylinders, with a\nthreshold depending on the window, is\n`TauCeti.SymplecticForm.exists_pos_forall_tendstoLocallyUniformlyOn_subseq_off_finset_cylindrical`.\n\nThe convergence is locally uniform. Energy may escape along the cylinder as `s \u2192 \u00b1\u221e`, which is\nhow broken trajectories arise; that, the bubbles at the points of the bubbling set, and the\nregularity of the limit are not treated here.\n\n## References\n\n* A. Floer, *Symplectic fixed points and holomorphic spheres*, Comm. Math. Phys. **120** (1989),\n 575\u2013611, on the compactness of spaces of connecting trajectories.\n* D. McDuff and D. Salamon, *J-holomorphic Curves and Symplectic Topology*, 2nd ed., Section 4.6\n (bubbling off finitely many points).\n-/\n\npublic section\n\nopen Filter Function MeasureTheory Metric Set Topology\n\nnamespace TauCeti.SymplecticForm\n\nvariable {V : Type*} [NormedAddCommGroup V] [InnerProductSpace \u211d V] [FiniteDimensional \u211d V]\n {Ks Kt : \u211d \u00d7 \u211d \u2192 V \u2192 \u211d} {J : \u211d \u00d7 \u211d \u2192 V \u2192 AlmostComplexStructure V}\n\n/-- The windows of `exists_pos_forall_tendstoLocallyUniformlyOn_subseq_off_finset_of_periodic`:\nfor data invariant under integer translations, the threshold `\u03b4` of the closed unit disc serves for\nthe open unit disc about every integer point `c = (m, n)`. Solutions with energy at most `E` over\neach of these discs have a subsequence and a finite set `Z` in the unit disc `ball 0 1` such that,\noff the translate `Z + c` of `Z`, the differentials are uniformly bounded on compact subsets of the\ndisc about `c` and the solutions converge locally uniformly there, and energy at least `\u03b4`\nconcentrates at the points of `Z + c`. -/\nprivate lemma exists_pos_forall_subseq_ball_add_int (\u03c9 : SymplecticForm V) {K : Set V}\n (hKs : ContDiff \u211d 3 (uncurry Ks)) (hKt : ContDiff \u211d 3 (uncurry Kt))\n (hJ : ContDiff \u211d 2 (fun p : (\u211d \u00d7 \u211d) \u00d7 V \u21a6 (J p.1 p.2).toLinearMap.toContinuousLinearMap))\n (hK : IsCompact K) (hJt : \u2200 z, \u2200 x \u2208 K, \u03c9.Tames (J z x))\n (hKsper : \u2200 (m n : \u2124) z, Ks (z + ((m : \u211d), (n : \u211d))) = Ks z)\n (hKtper : \u2200 (m n : \u2124) z, Kt (z + ((m : \u211d), (n : \u211d))) = Kt z)\n (hJper : \u2200 (m n : \u2124) z, J (z + ((m : \u211d), (n : \u211d))) = J z) :\n \u2203 \u03b4 > 0, \u2200 \u2983u : \u2115 \u2192 \u211d \u00d7 \u211d \u2192 V\u2984 \u2983E : \u211d\u2984, (\u2200 k, ContDiff \u211d 3 (u k)) \u2192\n (\u2200 k z, IsComplexLinearMap (AlmostComplexStructure.product \u211d) (J z (u k z))\n (\u03c9.perturbedFDeriv Ks Kt (u k) z : \u211d \u00d7 \u211d \u2192\u2097[\u211d] V)) \u2192\n (\u2200 k z, u k z \u2208 K) \u2192\n (\u2200 k (m n : \u2124), \u222b z in ball ((m : \u211d), (n : \u211d)) 1, \u03c9.floerEnergyDensity Ks Kt (u k) z \u2264 E) \u2192\n \u2200 m n : \u2124, \u2203 (\u03c8 : \u2115 \u2192 \u2115) (Z : Finset (\u211d \u00d7 \u211d)) (v : \u211d \u00d7 \u211d \u2192 V), StrictMono \u03c8 \u2227\n (\u2200 z \u2208 Z, \u2200 \u03b5 > 0, \u2200\u1da0 k in atTop, \u03b4 \u2264\n \u222b y in ball (z + ((m : \u211d), (n : \u211d))) \u03b5, \u03c9.floerEnergyDensity Ks Kt (u (\u03c8 k)) y) \u2227\n (\u2200 C, IsCompact C \u2192 C \u2286 (\u00b7 - ((m : \u211d), (n : \u211d))) \u207b\u00b9' (ball 0 1 \\ \u2191Z) \u2192\n \u2203 M, \u2200 k, \u2200 y \u2208 C, \u2016fderiv \u211d (u (\u03c8 k)) y\u2016 \u2264 M) \u2227\n TendstoLocallyUniformlyOn (fun k \u21a6 u (\u03c8 k)) v atTop\n ((\u00b7 - ((m : \u211d), (n : \u211d))) \u207b\u00b9' (ball 0 1 \\ \u2191Z)) := by\n -- The compactness theorem on the closed unit disc gives the threshold.\n obtain \u27e8\u03b4, h\u03b4, hconv\u27e9 := \u03c9.exists_pos_forall_tendstoLocallyUniformlyOn_subseq_off_finset\n isOpen_univ hKs.contDiffOn hKt.contDiffOn hJ.contDiffOn (isCompact_closedBall 0 1) hK\n (subset_univ _) fun z _ x hx \u21a6 hJt z x hx\n refine \u27e8\u03b4, h\u03b4, fun u E hu hfl huK hE m n \u21a6 ?_\u27e9\n set c : \u211d \u00d7 \u211d := ((m : \u211d), (n : \u211d))\n -- The window `z \u21a6 u k (z + c)` solves the Floer equation, and its energy density is a translate.\n have hKs' : (fun z \u21a6 Ks (z + c)) = Ks := funext (hKsper m n)\n have hKt' : (fun z \u21a6 Kt (z + c)) = Kt := funext (hKtper m n)\n have hflw (k : \u2115) (z : \u211d \u00d7 \u211d) : IsComplexLinearMap (AlmostComplexStructure.product \u211d)\n (J z (u k (z + c))) (\u03c9.perturbedFDeriv Ks Kt (fun y \u21a6 u k (y + c)) z : \u211d \u00d7 \u211d \u2192\u2097[\u211d] V) := by\n have h := \u03c9.perturbedFDeriv_comp_add_right Ks Kt (u k) c z\n rw [hKs', hKt'] at h\n rw [h, \u2190 hJper m n z]\n exact hfl k (z + c)\n have hfw (k : \u2115) (z : \u211d \u00d7 \u211d) : \u03c9.floerEnergyDensity Ks Kt (fun y \u21a6 u k (y + c)) z =\n \u03c9.floerEnergyDensity Ks Kt (u k) (z + c) := by\n have h := \u03c9.floerEnergyDensity_comp_add_right Ks Kt (u k) c z\n rwa [hKs', hKt'] at h\n have hint (k : \u2115) (z : \u211d \u00d7 \u211d) (\u03b5 : \u211d) :\n IntegrableOn (fun y \u21a6 \u03c9.floerEnergyDensity Ks Kt (u k) (y + c)) (ball z \u03b5) :=\n ((continuousOn_univ.1 (\u03c9.continuousOn_floerEnergyDensity isOpen_univ\n ((hu k).of_le (by norm_num)).contDiffOn (hKs.of_le (by norm_num)).contDiffOn\n (hKt.of_le (by norm_num)).contDiffOn)).comp (continuous_id.add continuous_const)\n |>.continuousOn.integrableOn_compact (isCompact_closedBall z \u03b5)).mono_set\n ball_subset_closedBall\n obtain \u27e8\u03c8, Z, v, h\u03c8, -, -, hconc, hbd, -, -, hlim\u27e9 :=\n hconv (\u03a9 := ball 0 1) (u := fun k y \u21a6 u k (y + c)) (E := E) isOpen_ball\n ball_subset_closedBall (fun k \u21a6 ((hu k).comp (contDiff_id.add contDiff_const)).contDiffOn)\n (fun k z _ \u21a6 hflw k z) (fun k z _ \u21a6 huK k _)\n (fun k \u21a6 (hint k 0 1).congr_fun (fun z _ \u21a6 (hfw k z).symm) isOpen_ball.measurableSet)\n (fun k \u21a6 by\n rw [setIntegral_congr_fun isOpen_ball.measurableSet fun z _ \u21a6 hfw k z,\n setIntegral_ball_comp_add_right, zero_add]\n exact hE k m n)\n -- Carry the conclusions back from the window to the plane.\n refine \u27e8\u03c8, Z, fun y \u21a6 v (y - c), h\u03c8, fun z hz \u03b5 h\u03b5 \u21a6 (hconc z hz \u03b5 h\u03b5).mono fun k hk \u21a6 ?_,\n fun C hC hCZ \u21a6 ?_, (hlim.comp (\u00b7 - c) (mapsTo_preimage _ _)\n (continuous_sub_right _).continuousOn).congr fun k y _ \u21a6 ?_\u27e9\n \u00b7 rw [setIntegral_congr_fun (measurableSet_ball.inter isOpen_ball.measurableSet)\n fun y _ \u21a6 hfw (\u03c8 k) y] at hk\n refine (hk.trans (setIntegral_mono_set (hint _ z \u03b5) (Eventually.of_forall fun y \u21a6\n \u03c9.floerEnergyDensity_nonneg (hJt _ _ (huK _ _)) (hfl _ _))\n inter_subset_left.eventuallySubset)).trans_eq (setIntegral_ball_comp_add_right _ z c \u03b5)\n \u00b7 obtain \u27e8M, hM\u27e9 := hbd _ (hC.image (continuous_sub_right c)) (image_subset_iff.2 hCZ)\n refine \u27e8M, fun k y hy \u21a6 ?_\u27e9\n simpa [fderiv_comp_add_right] using hM k (y - c) (mem_image_of_mem _ hy)\n \u00b7 simp\n\n", "statement": "/-- **Floer cylinders with doubly periodic data converge off finitely many bubbling points.** Let\n`K = K_s ds + K_t dt` be `C\u00b3` and `J(z, x)` be `C\u00b2` on `(\u211d \u00d7 \u211d) \u00d7 V`, invariant under the\ntranslations of the domain by the integer points `(m, n)`, with `J(z, x)` tamed by `\u03c9` for `x` in a\ncompact set `K`. There is a threshold `\u03b4 > 0` with the following property. Let `u\u2096 : \u211d \u00d7 \u211d \u2192 V` be\n`C\u00b3` solutions of the Floer equation `(du - X_K)^{0,1} = 0` for `J(z, u)`, `1`-periodic in `t` (that\nis, maps on the cylinder `\u211d \u00d7 S\u00b9`), with image in `K` and Floer energy\n`\u222b_{\u211d \u00d7 [0, 1)} \u03c9(\u2202\u209bu\u2096 - X_{K_s}, \u2202\u209cu\u2096 - X_{K_t}) \u2264 E`. Then there are a subsequence `\u03c6`, a finite\nset `Z` in the strip `\u211d \u00d7 [0, 1)` with `#Z * \u03b4 \u2264 E`, and a continuous `v`, `1`-periodic in `t` and\nwith values in `K`, off the translates `Z + (0, n)` of `Z`, such that along `\u03c6` every disc about a\npoint of `Z` eventually carries Floer energy at least `\u03b4`, the differentials are uniformly bounded\non every compact set disjoint from the translates of `Z`, and `u_{\u03c6 n} \u2192 v` locally uniformly off\nthe translates of `Z`. -/\ntheorem exists_pos_forall_tendstoLocallyUniformlyOn_subseq_off_finset_of_periodic\n (\u03c9 : SymplecticForm V) {K : Set V}\n (hKs : ContDiff \u211d 3 (uncurry Ks)) (hKt : ContDiff \u211d 3 (uncurry Kt))\n (hJ : ContDiff \u211d 2 (fun p : (\u211d \u00d7 \u211d) \u00d7 V \u21a6 (J p.1 p.2).toLinearMap.toContinuousLinearMap))\n (hK : IsCompact K) (hJt : \u2200 z, \u2200 x \u2208 K, \u03c9.Tames (J z x))\n (hKsper : \u2200 (m n : \u2124) z, Ks (z + ((m : \u211d), (n : \u211d))) = Ks z)\n (hKtper : \u2200 (m n : \u2124) z, Kt (z + ((m : \u211d), (n : \u211d))) = Kt z)\n (hJper : \u2200 (m n : \u2124) z, J (z + ((m : \u211d), (n : \u211d))) = J z) :\n \u2203 \u03b4 > 0, \u2200 \u2983u : \u2115 \u2192 \u211d \u00d7 \u211d \u2192 V\u2984 \u2983E : \u211d\u2984, (\u2200 k, ContDiff \u211d 3 (u k)) \u2192\n (\u2200 k s t, u k (s, t + 1) = u k (s, t)) \u2192\n (\u2200 k z, IsComplexLinearMap (AlmostComplexStructure.product \u211d) (J z (u k z))\n (\u03c9.perturbedFDeriv Ks Kt (u k) z : \u211d \u00d7 \u211d \u2192\u2097[\u211d] V)) \u2192\n (\u2200 k z, u k z \u2208 K) \u2192\n (\u2200 k, IntegrableOn (\u03c9.floerEnergyDensity Ks Kt (u k)) (univ \u00d7\u02e2 Ico 0 1)) \u2192\n (\u2200 k, \u222b z in univ \u00d7\u02e2 Ico 0 1, \u03c9.floerEnergyDensity Ks Kt (u k) z \u2264 E) \u2192\n \u2203 (\u03c6 : \u2115 \u2192 \u2115) (Z : Finset (\u211d \u00d7 \u211d)) (v : \u211d \u00d7 \u211d \u2192 V), StrictMono \u03c6 \u2227\n (Z : Set (\u211d \u00d7 \u211d)) \u2286 univ \u00d7\u02e2 Ico 0 1 \u2227 Z.card * \u03b4 \u2264 E \u2227\n (\u2200 z \u2208 Z, \u2200 \u03b5 > 0, \u2200\u1da0 n in atTop,\n \u03b4 \u2264 \u222b y in ball z \u03b5, \u03c9.floerEnergyDensity Ks Kt (u (\u03c6 n)) y) \u2227\n (\u2200 C, IsCompact C \u2192 C \u2286 {y : \u211d \u00d7 \u211d | (y.1, Int.fract y.2) \u2209 Z} \u2192\n \u2203 M, \u2200 n, \u2200 y \u2208 C, \u2016fderiv \u211d (u (\u03c6 n)) y\u2016 \u2264 M) \u2227\n ContinuousOn v {y : \u211d \u00d7 \u211d | (y.1, Int.fract y.2) \u2209 Z} \u2227\n MapsTo v {y : \u211d \u00d7 \u211d | (y.1, Int.fract y.2) \u2209 Z} K \u2227\n (\u2200 s t, v (s, t + 1) = v (s, t)) \u2227\n TendstoLocallyUniformlyOn (fun n \u21a6 u (\u03c6 n)) v atTop\n {y : \u211d \u00d7 \u211d | (y.1, Int.fract y.2) \u2209 Z} ", "proof": " by\n obtain \u27e8\u03b4, h\u03b4, hwin\u27e9 :=\n exists_pos_forall_subseq_ball_add_int \u03c9 hKs hKt hJ hK hJt hKsper hKtper hJper\n refine \u27e8\u03b4 / 2, half_pos h\u03b4, fun u E hu hper hfl huK hint hE \u21a6 ?_\u27e9\n set f : \u2115 \u2192 \u211d \u00d7 \u211d \u2192 \u211d := fun k \u21a6 \u03c9.floerEnergyDensity Ks Kt (u k)\n have hf0 (k : \u2115) (y : \u211d \u00d7 \u211d) : 0 \u2264 f k y :=\n \u03c9.floerEnergyDensity_nonneg (hJt y _ (huK k y)) (hfl k y)\n -- The energy densities are `1`-periodic in `t`.\n have hfk (k : \u2115) (s t : \u211d) : f k (s, t + 1) = f k (s, t) := by\n have h : Periodic (f k) (0, 1) := \u03c9.periodic_floerEnergyDensity\n (fun w \u21a6 by simpa using hKsper 0 1 w) (fun w \u21a6 by simpa using hKtper 0 1 w)\n fun \u27e8s, t\u27e9 \u21a6 by simpa using hper k s t\n simpa using h (s, t)\n -- The energy over the unit disc about each integer point is at most `2 * E`, so the windows\n -- apply to every subsequence; they are assembled into one subsequence on the cylinder.\n have hE2 (k : \u2115) (m n : \u2124) : \u222b z in ball ((m : \u211d), (n : \u211d)) 1, f k z \u2264 2 * E :=\n setIntegral_ball_intCast_le_two_mul_of_periodic (\u03bc := volume) (hf0 k) (hfk k) (hint k) (hE k)\n (m : \u211d) n\n obtain \u27e8\u03c6, Z, v, h\u03c6, hZ, hcard, hconc, hbd, hvper, hlim\u27e9 :=\n exists_tendstoLocallyUniformlyOn_subseq_off_finset_of_periodic (F := u)\n (g := fun k y \u21a6 \u2016fderiv \u211d (u k) y\u2016) h\u03b4 hf0 hfk hint hE hper\n (fun k \u21a6 ((hu k).continuous_fderiv (by norm_num)).norm) fun m \u03c8 _ \u21a6 by\n obtain \u27e8\u03c6, Z, v, h\u03c6, hconc, hbd, hlim\u27e9 := hwin (u := fun k \u21a6 u (\u03c8 k)) (fun k \u21a6 hu _)\n (fun k \u21a6 hfl _) (fun k \u21a6 huK _) (fun k \u21a6 hE2 _) m.1 m.2\n exact \u27e8\u03c6, h\u03c6, Z, v, hconc, hbd, hlim\u27e9\n exact \u27e8\u03c6, Z, v, h\u03c6, hZ, by linarith, fun z hz \u03b5 h\u03b5 \u21a6 (hconc z hz \u03b5 h\u03b5).mono fun n hn \u21a6\n (half_le_self h\u03b4.le).trans hn, hbd,\n hlim.continuousOn (Frequently.of_forall fun n \u21a6 (hu (\u03c6 n)).continuous.continuousOn),\n fun y hy \u21a6 hK.isClosed.mem_of_tendsto (hlim.tendsto_at hy)\n (Eventually.of_forall fun n \u21a6 huK _ y), hvper, hlim\u27e9", "proof_lines": 29, "proof_length": 1547, "rev": "75c8aed5fea63047615a25a9763fd5b68a86e891", "heartbeats": 4470, "image": "lean-compression:tauceti-75c8aed5fe-a608030cfc", "split": "dev"} {"path": "TauCeti/AlgebraicTopology/FundamentalGroup/TwoCellAttachment.lean", "module": "TauCeti.AlgebraicTopology.FundamentalGroup.TwoCellAttachment", "theorem": "TauCeti.TwoCellAttachment.isOpen_image_cell", "prefix": "/-\nCopyright (c) 2026 The Tau Ceti contributors. All rights reserved.\nReleased under Apache 2.0 license as described in the file LICENSE.\nAuthors: The Tau Ceti contributors\n-/\nmodule\n\npublic import Mathlib.AlgebraicTopology.FundamentalGroupoid.FundamentalGroup\npublic import Mathlib.AlgebraicTopology.FundamentalGroupoid.SimplyConnected\npublic import Mathlib.Topology.Homotopy.Path\nimport TauCeti.AlgebraicTopology.FundamentalGroup.Basic\nimport Mathlib.Topology.CompactOpen\nimport TauCeti.AlgebraicTopology.FundamentalGroupoid.CoverGeneration\nimport TauCeti.Topology.Homotopy.Path\nimport TauCeti.Topology.UnitInterval.OpenSquare\n\n/-!\n# Attaching 2-cells along loops\n\nLet `\u03b3 : \u03b9 \u2192 Path x x` be a family of loops at a point `x` of a space `X`. The space\n`TauCeti.TwoCellAttachment \u03b3` is obtained from `X` by attaching one 2-cell along each loop `\u03b3 i`.\nThe 2-cell is the square `I \u00d7 I`, attached along its boundary: the edge `{0} \u00d7 I` is glued to `X`\nalong `\u03b3 i`, and the other three edges are collapsed to `x`. A map of the square into a space `Y`\nwith this boundary behaviour is exactly a homotopy, relative to the endpoints, from the image of\n`\u03b3 i` to the constant path, so the square is a 2-cell bounding the loop `\u03b3 i`.\n\nThis is the operation that builds the presentation complex of a group presentation from a wedge\nof circles, and it is how the relators of a presentation are realized topologically: the loops\n`\u03b3 i` become nullhomotopic, and a map out of `X` extends over the attached cells exactly when it\nmakes every loop `\u03b3 i` nullhomotopic.\n\nThe space is the quotient of `X \u2295 \u03a3 _ : \u03b9, I \u00d7 I` which glues the boundary of each square to\n`X`; the quotient presentation is private, and the space is used through the inclusion `incl \u03b3`\nof `X`, the characteristic maps `cell \u03b3 i` of the cells, and the universal property `lift`.\n\nAttaching 2-cells does not create new loops: the inclusion of `X` induces a surjection on\nfundamental groups. The open square of each cell is embedded as an open, simply connected subset,\nthe open cell, and `X` is embedded as a closed subspace. Every loop is first pushed off the\ncentres of the cells through the open cells (`Path.exists_range_subset_homotopic`), and then\nretracted onto `X` along the radial deformation of each punctured cell onto its boundary\n(`unitInterval.radialPush`).\n\n## Main definitions\n\n* `TauCeti.TwoCellAttachment \u03b3`: the space obtained from `X` by attaching a 2-cell along each\n loop `\u03b3 i`.\n* `TauCeti.TwoCellAttachment.incl`: the inclusion of `X`.\n* `TauCeti.TwoCellAttachment.cell`: the characteristic map of the `i`-th cell.\n* `TauCeti.TwoCellAttachment.cellHomotopy`: the `i`-th cell, as a nullhomotopy of the image of\n `\u03b3 i`.\n* `TauCeti.TwoCellAttachment.lift`: the universal property, which extends a map out of `X`\n together with nullhomotopies of the images of the loops.\n* `TauCeti.TwoCellAttachment.inclHomeomorphOfIsEmpty`: with no loops, the inclusion of `X` is a\n homeomorphism.\n\n## Main results\n\n* `TauCeti.TwoCellAttachment.isQuotientMap_sumElim`: the space is a quotient of\n `X \u2295 \u03a3 _ : \u03b9, I \u00d7 I`.\n* `TauCeti.TwoCellAttachment.instPathConnectedSpace`: the space is path connected when `X` is.\n* `TauCeti.TwoCellAttachment.hom_ext`: maps out of the space are determined on `X` and the cells.\n* `TauCeti.TwoCellAttachment.exists_comp_incl_eq_iff`: a map out of `X` extends over the attached\n cells exactly when it makes every loop `\u03b3 i` nullhomotopic.\n* `TauCeti.TwoCellAttachment.map_incl_fromPath`: the inclusion kills the class of every loop\n `\u03b3 i` in the fundamental group.\n* `TauCeti.TwoCellAttachment.cell_eq_cell_iff`, `TauCeti.TwoCellAttachment.incl_ne_cell`: a point\n of the open square of a cell is identified with no other point.\n* `TauCeti.TwoCellAttachment.isOpenEmbedding_restrict_cell`,\n `TauCeti.TwoCellAttachment.isSimplyConnected_image_cell`: the open cells are open, embedded and\n simply connected.\n* `TauCeti.TwoCellAttachment.cell_eq_incl_iff`: the points of a cell which are points of `X`.\n* `TauCeti.TwoCellAttachment.isClosedEmbedding_incl`: `X` is a closed subspace.\n* `TauCeti.TwoCellAttachment.surjective_map_incl`: the inclusion of `X` induces a surjection on\n fundamental groups.\n\n## References\n\n* A. Hatcher, [*Algebraic Topology*](https://pi.math.cornell.edu/~hatcher/AT/AT.pdf),\n Chapter 0 for attaching cells, and Section 1.2, Proposition 1.26 for the effect of attaching\n 2-cells on the fundamental group.\n-/\n\npublic section\n\nnoncomputable section\n\nnamespace TauCeti\n\nopen Set Topology unitInterval\n\nuniverse u v w\n\nvariable {X : Type u} [TopologicalSpace X] {x : X} {\u03b9 : Type v}\n\n/-- The normal form of a point of `X \u2295 \u03a3 _ : \u03b9, I \u00d7 I` for attaching 2-cells along the loops `\u03b3`:\na point `(s, t)` on the boundary of the `i`-th square is sent to the point of `X` it is glued to,\nwhich is `\u03b3 i t` on the edge `s = 0` and `x` on the other three edges, and every other point to\nitself. Two points have the same normal form exactly when the attachment identifies them. -/\nprivate def cellNormalize (\u03b3 : \u03b9 \u2192 Path x x) (a : X \u2295 \u03a3 _ : \u03b9, I \u00d7 I) : X \u2295 \u03a3 _ : \u03b9, I \u00d7 I :=\n open Classical in\n a.elim .inl fun q =>\n if q.2.1 = 0 then .inl (\u03b3 q.1 q.2.2)\n else if q.2.1 = 1 \u2228 q.2.2 = 0 \u2228 q.2.2 = 1 then .inl x\n else .inr q\n\nprivate lemma cellNormalize_cellNormalize (\u03b3 : \u03b9 \u2192 Path x x) (a : X \u2295 \u03a3 _ : \u03b9, I \u00d7 I) :\n cellNormalize \u03b3 (cellNormalize \u03b3 a) = cellNormalize \u03b3 a := by\n rcases a with y | q\n \u00b7 rfl\n \u00b7 simp only [cellNormalize, Sum.elim_inr]\n split_ifs with h\u2080 h\u2081 <;> simp_all\n\n/-- The space obtained from `X` by attaching a 2-cell along each loop `\u03b3 i`: the square `I \u00d7 I`,\nwith the edge `{0} \u00d7 I` glued to `X` along `\u03b3 i` and the other three edges collapsed to `x`. It\ncarries the quotient topology.\n\nThe presentation as a quotient is private: points come from `TauCeti.TwoCellAttachment.incl`\nand `TauCeti.TwoCellAttachment.cell`, maps out of the space from\n`TauCeti.TwoCellAttachment.lift`, and statements about all of its points from\n`TauCeti.TwoCellAttachment.ind`. -/\ndef TwoCellAttachment (\u03b3 : \u03b9 \u2192 Path x x) : Type max u v :=\n Quotient (Setoid.ker (cellNormalize \u03b3))\n\nnamespace TwoCellAttachment\n\nvariable (\u03b3 : \u03b9 \u2192 Path x x)\n\n/-! The topology is transported from the private quotient; the instance is `@[no_expose]`, which\nis what lets its body name the private constant. -/\n\n@[no_expose] instance : TopologicalSpace (TwoCellAttachment \u03b3) :=\n inferInstanceAs (TopologicalSpace (Quotient (Setoid.ker (cellNormalize \u03b3))))\n\n/-- The inclusion of `X` into the space with the 2-cells attached. -/\ndef incl : C(X, TwoCellAttachment \u03b3) :=\n \u27e8fun y => Quotient.mk _ (.inl y), continuous_quot_mk.comp continuous_inl\u27e9\n\n/-- The characteristic map of the `i`-th attached cell, the square `I \u00d7 I`. -/\ndef cell (i : \u03b9) : C(I \u00d7 I, TwoCellAttachment \u03b3) :=\n \u27e8fun p => Quotient.mk _ (.inr \u27e8i, p\u27e9),\n continuous_quot_mk.comp (continuous_inr.comp continuous_sigmaMk)\u27e9\n\nvariable {\u03b3}\n\n/-- The quotient map onto the space with the cells attached. -/\nprivate def mk (\u03b3 : \u03b9 \u2192 Path x x) (a : X \u2295 \u03a3 _ : \u03b9, I \u00d7 I) : TwoCellAttachment \u03b3 :=\n Quotient.mk _ a\n\nprivate lemma mk_cellNormalize (a : X \u2295 \u03a3 _ : \u03b9, I \u00d7 I) :\n mk \u03b3 (cellNormalize \u03b3 a) = mk \u03b3 a :=\n Quotient.sound (cellNormalize_cellNormalize \u03b3 a)\n\nprivate lemma mk_inl (y : X) : mk \u03b3 (.inl y) = incl \u03b3 y :=\n (rfl)\n\nprivate lemma mk_inr (i : \u03b9) (q : I \u00d7 I) : mk \u03b3 (.inr \u27e8i, q\u27e9) = cell \u03b3 i q :=\n (rfl)\n\n/-- The edge `{0} \u00d7 I` of the `i`-th cell is glued to `X` along the loop `\u03b3 i`. -/\n@[simp]\nlemma cell_apply_zero (i : \u03b9) (t : I) : cell \u03b3 i (0, t) = incl \u03b3 (\u03b3 i t) := by\n rw [\u2190 mk_inr, \u2190 mk_cellNormalize]\n simp [cellNormalize, mk_inl]\n\n/-- The edge `{1} \u00d7 I` of the `i`-th cell is collapsed to the base point. -/\n@[simp]\nlemma cell_apply_one (i : \u03b9) (t : I) : cell \u03b3 i (1, t) = incl \u03b3 x := by\n rw [\u2190 mk_inr, \u2190 mk_cellNormalize]\n simp [cellNormalize, mk_inl]\n\n/-- The edge `I \u00d7 {0}` of the `i`-th cell is collapsed to the base point. -/\n@[simp]\nlemma cell_source (i : \u03b9) (s : I) : cell \u03b3 i (s, 0) = incl \u03b3 x := by\n rw [\u2190 mk_inr, \u2190 mk_cellNormalize]\n by_cases hs : s = 0\n \u00b7 simp [cellNormalize, mk_inl, hs]\n \u00b7 simp [cellNormalize, mk_inl, hs]\n\n/-- The edge `I \u00d7 {1}` of the `i`-th cell is collapsed to the base point. -/\n@[simp]\nlemma cell_target (i : \u03b9) (s : I) : cell \u03b3 i (s, 1) = incl \u03b3 x := by\n rw [\u2190 mk_inr, \u2190 mk_cellNormalize]\n by_cases hs : s = 0\n \u00b7 simp [cellNormalize, mk_inl, hs]\n \u00b7 simp [cellNormalize, mk_inl, hs]\n\n/-- Every point of the space comes from `X` or from one of the attached cells. -/\n@[elab_as_elim]\nlemma ind {p : TwoCellAttachment \u03b3 \u2192 Prop} (incl : \u2200 y, p (incl \u03b3 y))\n (cell : \u2200 i q, p (cell \u03b3 i q)) (z : TwoCellAttachment \u03b3) : p z := by\n induction z using Quotient.ind with\n | _ a => cases a with\n | inl y => exact incl y\n | inr q => exact cell q.1 q.2\n\n/-- **The space is a quotient of `X \u2295 \u03a3 _ : \u03b9, I \u00d7 I`**, by the inclusion of `X` and the\ncharacteristic maps of the cells. -/\ntheorem isQuotientMap_sumElim :\n IsQuotientMap (Sum.elim (incl \u03b3) fun q : \u03a3 _ : \u03b9, I \u00d7 I => cell \u03b3 q.1 q.2) := by\n have h : (Sum.elim (incl \u03b3) fun q : \u03a3 _ : \u03b9, I \u00d7 I => cell \u03b3 q.1 q.2) =\n Quotient.mk (Setoid.ker (cellNormalize \u03b3)) := by\n funext a\n cases a <;> rfl\n rw [h]\n exact isQuotientMap_quot_mk\n\n/-- **Attaching 2-cells to a path-connected space gives a path-connected space**: every point of\na cell is joined inside the cell to its edge `{1} \u00d7 I`, which is collapsed to the base point. -/\ninstance instPathConnectedSpace [PathConnectedSpace X] :\n PathConnectedSpace (TwoCellAttachment \u03b3) := by\n have h (z : TwoCellAttachment \u03b3) : Joined (incl \u03b3 x) z := by\n induction z using ind with\n | incl y => exact (PathConnectedSpace.joined x y).map (incl \u03b3).continuous\n | cell i q =>\n -- The horizontal segment from `(1, q.2)` to `q` inside the square.\n let p : Path ((1 : I), q.2) q :=\n { toFun r := (Set.Icc.convexComb 1 q.1 r, q.2)\n continuous_toFun := by fun_prop\n source' := by simp\n target' := by simp }\n rw [\u2190 cell_apply_one i q.2]\n exact \u27e8p.map (cell \u03b3 i).continuous\u27e9\n exact \u27e8\u27e8incl \u03b3 x\u27e9, fun v w => (h v).symm.trans (h w)\u27e9\n\nsection Lift\n\nvariable {Y : Type w} [TopologicalSpace Y]\n\n/-- **The universal property of attaching 2-cells.** A map `f` out of `X`, together with a\nnullhomotopy `H i` of the image under `f` of each loop `\u03b3 i`, extends over the attached cells: the\n`i`-th cell is sent to `Y` by `H i`. -/\ndef lift (f : C(X, Y)) (H : \u2200 i, Path.Homotopy ((\u03b3 i).map f.continuous) (Path.refl (f x))) :\n C(TwoCellAttachment \u03b3, Y) :=\n \u27e8Quotient.lift (Sum.elim f fun q => H q.1 q.2) fun a b hab => by\n -- The map out of `X \u2295 \u03a3 _ : \u03b9, I \u00d7 I` is constant along the normal form, so it is\n -- constant on the fibres of the normal form.\n have key (c : X \u2295 \u03a3 _ : \u03b9, I \u00d7 I) : Sum.elim f (fun q => H q.1 q.2) (cellNormalize \u03b3 c) =\n Sum.elim f (fun q => H q.1 q.2) c := by\n rcases c with y | \u27e8i, s, t\u27e9\n \u00b7 rfl\n \u00b7 simp only [cellNormalize, Sum.elim_inr]\n split_ifs with h\u2080 h\u2081\n \u00b7 simp [h\u2080]\n \u00b7 rcases h\u2081 with h\u2081 | h\u2081 | h\u2081 <;> simp [h\u2081]\n \u00b7 rfl\n exact (key a).symm.trans ((congrArg _ hab).trans (key b)),\n Continuous.quotient_lift\n (f.continuous.sumElim (continuous_sigma fun i => (H i).continuous)) _\u27e9\n\n@[simp]\nlemma lift_incl (f : C(X, Y)) (H : \u2200 i, Path.Homotopy ((\u03b3 i).map f.continuous) (Path.refl (f x)))\n (y : X) : lift f H (incl \u03b3 y) = f y := (rfl)\n\n@[simp]\nlemma lift_cell (f : C(X, Y)) (H : \u2200 i, Path.Homotopy ((\u03b3 i).map f.continuous) (Path.refl (f x)))\n (i : \u03b9) (q : I \u00d7 I) : lift f H (cell \u03b3 i q) = H i q := (rfl)\n\n@[simp]\nlemma lift_comp_incl (f : C(X, Y))\n (H : \u2200 i, Path.Homotopy ((\u03b3 i).map f.continuous) (Path.refl (f x))) :\n (lift f H).comp (incl \u03b3) = f := (rfl)\n\n/-- **Extensionality for maps out of the space.** Two maps which agree on `X` and on every\nattached cell are equal. -/\n@[ext]\ntheorem hom_ext {f g : C(TwoCellAttachment \u03b3, Y)} (h : f.comp (incl \u03b3) = g.comp (incl \u03b3))\n (hcell : \u2200 i, f.comp (cell \u03b3 i) = g.comp (cell \u03b3 i)) : f = g := by\n refine ContinuousMap.ext fun z => ?_\n induction z using ind with\n | incl y => exact DFunLike.congr_fun h y\n | cell i q => exact DFunLike.congr_fun (hcell i) q\n\nend Lift\n\n/-! ### The attached cells as nullhomotopies -/\n\n/-- The `i`-th attached cell is a nullhomotopy, relative to the endpoints, of the image of the\nloop `\u03b3 i` in the space. -/\ndef cellHomotopy (i : \u03b9) :\n Path.Homotopy ((\u03b3 i).map (incl \u03b3).continuous) (Path.refl (incl \u03b3 x)) where\n toContinuousMap := cell \u03b3 i\n map_zero_left t := by simp\n map_one_left t := by simp\n prop' s t ht := by\n rcases ht with rfl | rfl <;> simp\n\n@[simp]\nlemma cellHomotopy_apply (i : \u03b9) (q : I \u00d7 I) : cellHomotopy (\u03b3 := \u03b3) i q = cell \u03b3 i q := (rfl)\n\n/-- Every loop `\u03b3 i` becomes nullhomotopic in the space with the 2-cells attached. -/\ntheorem homotopic_map_incl (i : \u03b9) :\n ((\u03b3 i).map (incl \u03b3).continuous).Homotopic (Path.refl (incl \u03b3 x)) :=\n \u27e8cellHomotopy i\u27e9\n\n/-- **The attached cells kill the loops.** The class of every loop `\u03b3 i` is sent to `1` in the\nfundamental group of the space with the 2-cells attached. -/\n@[simp]\ntheorem map_incl_fromPath (i : \u03b9) :\n FundamentalGroup.map (incl \u03b3) x\n (FundamentalGroup.fromPath (Path.Homotopic.Quotient.mk (\u03b3 i))) = 1 := by\n rw [TauCeti.FundamentalGroup.map_fromPath]\n exact congrArg CategoryTheory.End.of (Quotient.sound (homotopic_map_incl i))\n\nvariable {Y : Type w} [TopologicalSpace Y]\n\n/-- **Maps extend over the attached cells exactly when they kill the loops.** A map out of `X`\nis the restriction of a map out of the space with the 2-cells attached if and only if the image\nof every loop `\u03b3 i` is nullhomotopic relative to its endpoints. -/\ntheorem exists_comp_incl_eq_iff (f : C(X, Y)) :\n (\u2203 g : C(TwoCellAttachment \u03b3, Y), g.comp (incl \u03b3) = f) \u2194\n \u2200 i, ((\u03b3 i).map f.continuous).Homotopic (Path.refl (f x)) := by\n constructor\n \u00b7 rintro \u27e8g, rfl\u27e9 i\n have hrefl : (Path.refl (incl \u03b3 x)).map g.continuous = Path.refl (g (incl \u03b3 x)) := by\n ext\n simp\n have h := (homotopic_map_incl (\u03b3 := \u03b3) i).map g\n rw [Path.map_map, hrefl] at h\n -- `h` is the goal up to unfolding `ContinuousMap.coe_comp` in the endpoints.\n exact h\n \u00b7 intro h\n exact \u27e8lift f fun i => (h i).some, lift_comp_incl _ _\u27e9\n\n/-! ### The open cells -/\n\nsection OpenCell\n\nvariable {i : \u03b9} {q : I \u00d7 I}\n\n/-- A point of the open square is its own normal form. -/\nprivate lemma cellNormalize_inr_of_mem (hq : q \u2208 Ioo 0 1 \u00d7\u02e2 Ioo 0 1) :\n cellNormalize \u03b3 (.inr \u27e8i, q\u27e9) = .inr \u27e8i, q\u27e9 := by\n obtain \u27e8\u27e8h\u2080, h\u2081\u27e9, h\u2082, h\u2083\u27e9 := hq\n simp [cellNormalize, h\u2080.ne', h\u2081.ne, h\u2082.ne', h\u2083.ne]\n\n/-- Only a point of a square can have that point as its normal form. -/\nprivate lemma eq_of_cellNormalize_eq_inr {a : X \u2295 \u03a3 _ : \u03b9, I \u00d7 I}\n (h : cellNormalize \u03b3 a = .inr \u27e8i, q\u27e9) : a = .inr \u27e8i, q\u27e9 := by\n rcases a with y | \u27e8j, q'\u27e9\n \u00b7 simp [cellNormalize] at h\n \u00b7 simp only [cellNormalize, Sum.elim_inr] at h\n split_ifs at h with h\u2080 h\u2081\n simp_all\n\n/-- A point of the open square of a cell is identified with no other point. -/\nprivate lemma mk_eq_cell_iff (hq : q \u2208 Ioo 0 1 \u00d7\u02e2 Ioo 0 1) {a : X \u2295 \u03a3 _ : \u03b9, I \u00d7 I} :\n mk \u03b3 a = cell \u03b3 i q \u2194 a = .inr \u27e8i, q\u27e9 := by\n refine \u27e8fun h => eq_of_cellNormalize_eq_inr (\u03b3 := \u03b3) ?_, fun h => h \u25b8 rfl\u27e9\n rw [\u2190 cellNormalize_inr_of_mem hq]\n exact Quotient.exact h\n\nprivate lemma sumElim_eq_mk (a : X \u2295 \u03a3 _ : \u03b9, I \u00d7 I) :\n Sum.elim (incl \u03b3) (fun q : \u03a3 _ : \u03b9, I \u00d7 I => cell \u03b3 q.1 q.2) a = mk \u03b3 a := by\n rcases a with _ | _ <;> rfl\n\n/-- A point of `X` is not a point of the open square of a cell. -/\ntheorem incl_ne_cell (hq : q \u2208 Ioo 0 1 \u00d7\u02e2 Ioo 0 1) (y : X) : incl \u03b3 y \u2260 cell \u03b3 i q := by\n rw [\u2190 mk_inl, Ne, mk_eq_cell_iff hq]\n simp\n\n/-- A point of a cell agrees with a point of the open square of a cell only when they are the same\npoint of the same cell. -/\ntheorem cell_eq_cell_iff (hq : q \u2208 Ioo 0 1 \u00d7\u02e2 Ioo 0 1) {j : \u03b9} {q' : I \u00d7 I} :\n cell \u03b3 j q' = cell \u03b3 i q \u2194 j = i \u2227 q' = q := by\n rw [\u2190 mk_inr, mk_eq_cell_iff hq]\n simp\n\n", "statement": "/-- The image of an open subset of the open square of a cell is open. -/\ntheorem isOpen_image_cell {V : Set (I \u00d7 I)} (hV : IsOpen V) (hVq : V \u2286 Ioo 0 1 \u00d7\u02e2 Ioo 0 1) :\n IsOpen (cell \u03b3 i '' V) ", "proof": " by\n rw [\u2190 isQuotientMap_sumElim.isOpen_preimage]\n have h : Sum.elim (incl \u03b3) (fun q : \u03a3 _ : \u03b9, I \u00d7 I => cell \u03b3 q.1 q.2) \u207b\u00b9' (cell \u03b3 i '' V) =\n Sum.inr '' (Sigma.mk i '' V) := by\n ext a\n simp only [mem_preimage, sumElim_eq_mk]\n constructor\n \u00b7 rintro \u27e8q, hq, h\u27e9\n exact \u27e8\u27e8i, q\u27e9, \u27e8q, hq, rfl\u27e9, ((mk_eq_cell_iff (hVq hq)).1 h.symm).symm\u27e9\n \u00b7 rintro \u27e8_, \u27e8q, hq, rfl\u27e9, rfl\u27e9\n exact \u27e8q, hq, rfl\u27e9\n rw [h]\n exact isOpenMap_inr _ (isOpenMap_sigmaMk _ hV)", "proof_lines": 12, "proof_length": 429, "rev": "75c8aed5fea63047615a25a9763fd5b68a86e891", "heartbeats": 433, "image": "lean-compression:tauceti-75c8aed5fe-a608030cfc", "split": "dev"} {"path": "TauCeti/Analysis/CStarAlgebra/UniversalUnitary.lean", "module": "TauCeti.Analysis.CStarAlgebra.UniversalUnitary", "theorem": "TauCeti.UniversalUnitaryCStarAlgebra.topologicalClosure_adjoin_range_generator", "prefix": "/-\nCopyright (c) 2026 The Tau Ceti contributors. All rights reserved.\nReleased under Apache 2.0 license as described in the file LICENSE.\nAuthors: The Tau Ceti contributors\n-/\nmodule\n\npublic import Mathlib.Analysis.CStarAlgebra.ContinuousLinearMap\npublic import Mathlib.Analysis.CStarAlgebra.Spectrum\npublic import Mathlib.Analysis.Normed.Module.Completion\npublic import Mathlib.Analysis.Normed.Module.Seminorm.Basic\npublic import Mathlib.GroupTheory.FreeGroup.Basic\npublic import TauCeti.Algebra.MonoidAlgebra.Star\npublic import TauCeti.Analysis.CStarAlgebra.Completion\nimport Mathlib.Analysis.CStarAlgebra.Hom\nimport TauCeti.Algebra.MonoidAlgebra.Basic\nimport Mathlib.SetTheory.Cardinal.Free\nimport TauCeti.Analysis.CStarAlgebra.MonoidAlgebra\nimport TauCeti.Analysis.CStarAlgebra.Representation.Compression\nimport TauCeti.Analysis.CStarAlgebra.Representation.GNS\nimport TauCeti.Analysis.CStarAlgebra.Seminorm\n\n/-!\n# The universal C\u22c6-algebra generated by unitaries\n\nFor a type `\u03b9 : Type u`, the *universal unital C\u22c6-algebra on unitary generators indexed by `\u03b9`*\nis the completion of the group \u22c6-algebra `\u2102[F_\u03b9]` of the free group on `\u03b9` in the universal\nC\u22c6-seminorm\n\n`\u2016x\u2016\u1d64 = sup \u2016\u03c1(x)\u2016`,\n\nthe supremum over all unitary representations `\u03c1` of `F_\u03b9` on Hilbert spaces, that is, over all\nfamilies of unitaries indexed by `\u03b9` (Blackadar II.8.3.1\u2013II.8.3.2). For `\u03b9 = \u2115` this is\n`C*(F_\u221e)`, the universal C\u22c6-algebra on countably many unitaries.\n\nThe supremum ranges over representations on Hilbert spaces in the universe `u`. This loses\nnothing: every vector of a representation on a Hilbert space in any universe lies in an invariant\nsubspace isometric to a Hilbert space in the universe `u`, the closure of its orbit under\n`\u2102[F_\u03b9] : Type u`. So every \u22c6-representation of `\u2102[F_\u03b9]` on any Hilbert space, and by the\nGelfand\u2013Naimark theorem every unital \u22c6-homomorphism into any unital C\u22c6-algebra, is bounded by the\nuniversal seminorm (`UniversalUnitaryCStarAlgebra.norm_apply_le_universalSeminorm`). Since every\ngroup element acts unitarily, the supremum is bounded by the `\u2113\u00b9` norm of the coefficients.\n\nThe completion `UniversalUnitaryCStarAlgebra \u03b9` is a unital C\u22c6-algebra. Its generators\n`UniversalUnitaryCStarAlgebra.generator i` are unitaries, and it has the universal property:\nevery family of unitaries `\u03b9 \u2192 unitary B` in a unital C\u22c6-algebra `B`, in any universe, comes from\na unique unital \u22c6-homomorphism (`UniversalUnitaryCStarAlgebra.lift`). It is separable when `\u03b9` is\ncountable. A definition through a single representation, for instance the left regular one,\nwould lose the universal property.\n\n## Main definitions\n\n* `TauCeti.UniversalUnitaryCStarAlgebra.universalSeminorm`: the universal C\u22c6-seminorm on\n `\u2102[F_\u03b9]`.\n* `TauCeti.FreeUnitaryAlgebra \u03b9`: the group \u22c6-algebra `\u2102[F_\u03b9]` with the universal seminorm.\n* `TauCeti.UniversalUnitaryCStarAlgebra \u03b9`: its completion, a unital C\u22c6-algebra; for `\u03b9 = \u2115`\n this is `C*(F_\u221e)`.\n* `TauCeti.UniversalUnitaryCStarAlgebra.of`: the canonical unital \u22c6-homomorphism from `\u2102[F_\u03b9]`,\n with dense range.\n* `TauCeti.UniversalUnitaryCStarAlgebra.generator`: the unitary generators.\n* `TauCeti.UniversalUnitaryCStarAlgebra.lift`: unital \u22c6-homomorphisms into a unital C\u22c6-algebra\n `B` are the families of unitaries of `B` indexed by `\u03b9`.\n\n## Main statements\n\n* `TauCeti.UniversalUnitaryCStarAlgebra.norm_apply_le_universalSeminorm`: every unital\n \u22c6-homomorphism from `\u2102[F_\u03b9]` into a unital C\u22c6-algebra is bounded by the universal seminorm.\n* `TauCeti.UniversalUnitaryCStarAlgebra.universalSeminorm_le_iff`: the universal seminorm is the\n least bound for the representations on Hilbert spaces in the universe of `\u03b9`.\n* `TauCeti.UniversalUnitaryCStarAlgebra.norm_of`: `\u2016of x\u2016 = \u2016x\u2016\u1d64`.\n* `TauCeti.UniversalUnitaryCStarAlgebra.lift_generator` and\n `TauCeti.UniversalUnitaryCStarAlgebra.hom_ext`: the universal property.\n* `TauCeti.UniversalUnitaryCStarAlgebra.topologicalClosure_adjoin_range_generator`: the\n generators generate it as a C\u22c6-algebra.\n* `TauCeti.UniversalUnitaryCStarAlgebra.instSeparableSpace`: it is separable for countable `\u03b9`.\n\n## References\n\n* B. Blackadar, *Operator Algebras: Theory of C\u22c6-Algebras and von Neumann Algebras*,\n II.8.3.1\u2013II.8.3.2.\n-/\n\npublic section\n\nnoncomputable section\n\nopen UniformSpace MonoidAlgebra\n\nnamespace TauCeti\n\nuniverse u w\n\nnamespace UniversalUnitaryCStarAlgebra\n\nvariable {\u03b9 : Type u}\n\nvariable (\u03b9) in\n/-- The seminorms `x \u21a6 \u2016\u03c1 x\u2016` of the unitary representations `\u03c1` of `F_\u03b9` on Hilbert spaces in\nthe universe `u`. -/\nprivate def representationSeminorms : Set (Seminorm \u2102 (MonoidAlgebra \u2102 (FreeGroup \u03b9))) :=\n {p | \u2203 (H : Type u) (_ : NormedAddCommGroup H) (_ : InnerProductSpace \u2102 H)\n (_ : CompleteSpace H) (\u03c1 : MonoidAlgebra \u2102 (FreeGroup \u03b9) \u2192\u22c6\u2090[\u2102] (H \u2192L[\u2102] H)),\n p = (normSeminorm \u2102 (H \u2192L[\u2102] H)).comp\n (\u03c1 : MonoidAlgebra \u2102 (FreeGroup \u03b9) \u2192\u2097[\u2102] (H \u2192L[\u2102] H))}\n\nprivate theorem bddAbove_representationSeminorms : BddAbove (representationSeminorms \u03b9) :=\n Seminorm.bddAbove_iff.2 \u27e8fun x => x.coeff.sum fun _ r => \u2016r\u2016, by\n rintro _ \u27e8_, \u27e8H, _, _, _, \u03c1, rfl\u27e9, rfl\u27e9 x\n exact norm_starAlgHom_apply_le_sum_norm_coeff \u03c1 x\u27e9\n\nvariable (\u03b9) in\n/-- The universal C\u22c6-seminorm `\u2016x\u2016\u1d64 = sup \u2016\u03c1 x\u2016` on the group algebra `\u2102[F_\u03b9]`: the supremum of\nthe norms of the unitary representations of the free group `F_\u03b9` on Hilbert spaces in the\nuniverse of `\u03b9`. Its completion is `UniversalUnitaryCStarAlgebra \u03b9`. -/\ndef universalSeminorm : Seminorm \u2102 (MonoidAlgebra \u2102 (FreeGroup \u03b9)) :=\n sSup (representationSeminorms \u03b9)\n\n/-- Every \u22c6-representation of `\u2102[F_\u03b9]` on a Hilbert space in any universe is bounded by the\nuniversal seminorm. Each vector lies in an invariant subspace isometric to a Hilbert space in the\nuniverse of `\u03b9`, on which the representation is one of those defining the universal seminorm. -/\ntheorem norm_le_universalSeminorm {H : Type w} [NormedAddCommGroup H] [InnerProductSpace \u2102 H]\n [CompleteSpace H] (\u03c1 : MonoidAlgebra \u2102 (FreeGroup \u03b9) \u2192\u22c6\u2090[\u2102] (H \u2192L[\u2102] H))\n (x : MonoidAlgebra \u2102 (FreeGroup \u03b9)) : \u2016\u03c1 x\u2016 \u2264 universalSeminorm \u03b9 x := by\n refine (\u03c1 x).opNorm_le_bound (apply_nonneg _ x) fun \u03be => ?_\n obtain \u27e8K, _, _, _, V, hV, \u03b7, rfl\u27e9 := \u03c1.toAlgHom.exists_isometry_mapsTo_mem_range \u03be\n have hK : \u2016\u03c1.compression V hV x\u2016 \u2264 universalSeminorm \u03b9 x :=\n le_csSup bddAbove_representationSeminorms \u27e8K, _, _, _, \u03c1.compression V hV, rfl\u27e9 x\n rw [\u2190 \u03c1.apply_compression_apply V hV, V.norm_map, V.norm_map]\n exact (\u03c1.compression V hV x).le_of_opNorm_le hK \u03b7\n\n/-- **The universal seminorm bounds every unital \u22c6-homomorphism** from `\u2102[F_\u03b9]` into a unital\nC\u22c6-algebra in any universe: compose with a faithful representation (Gelfand\u2013Naimark), which is\nisometric. -/\ntheorem norm_apply_le_universalSeminorm {B : Type w} [CStarAlgebra B]\n (\u03c6 : MonoidAlgebra \u2102 (FreeGroup \u03b9) \u2192\u22c6\u2090[\u2102] B) (x : MonoidAlgebra \u2102 (FreeGroup \u03b9)) :\n \u2016\u03c6 x\u2016 \u2264 universalSeminorm \u03b9 x := by\n obtain \u27e8H, _, _, _, \u03c0, h\u03c0\u27e9 := TauCeti.CStarAlgebra.exists_faithful_representation B\n rw [\u2190 NonUnitalStarAlgHom.norm_map \u03c0 h\u03c0]\n exact norm_le_universalSeminorm (\u03c0.comp \u03c6) x\n\n/-- The universal seminorm is the least bound for the unitary representations of `F_\u03b9` on\nHilbert spaces in the universe of `\u03b9`. -/\ntheorem universalSeminorm_le_iff {x : MonoidAlgebra \u2102 (FreeGroup \u03b9)} {c : \u211d} :\n universalSeminorm \u03b9 x \u2264 c \u2194\n \u2200 (H : Type u) [NormedAddCommGroup H] [InnerProductSpace \u2102 H] [CompleteSpace H]\n (\u03c1 : MonoidAlgebra \u2102 (FreeGroup \u03b9) \u2192\u22c6\u2090[\u2102] (H \u2192L[\u2102] H)), \u2016\u03c1 x\u2016 \u2264 c := by\n refine \u27e8fun h _ _ _ _ \u03c1 => (norm_le_universalSeminorm \u03c1 x).trans h, fun h => ?_\u27e9\n have hc : 0 \u2264 c := by\n let H := EuclideanSpace \u2102 PEmpty.{u + 1}\n exact (norm_nonneg _).trans (h H (starLift \u2102 (FreeGroup \u03b9) (H \u2192L[\u2102] H) 1))\n exact Seminorm.sSup_apply_le bddAbove_representationSeminorms hc\n fun _ \u27e8H, _, _, _, \u03c1, hp\u27e9 => hp \u25b8 h H \u03c1\n\n/-- The universal seminorm is bounded by the `\u2113\u00b9` norm of the coefficients. -/\ntheorem universalSeminorm_le_sum_norm_coeff (x : MonoidAlgebra \u2102 (FreeGroup \u03b9)) :\n universalSeminorm \u03b9 x \u2264 x.coeff.sum fun _ r => \u2016r\u2016 :=\n universalSeminorm_le_iff.2 fun _ _ _ _ \u03c1 => norm_starAlgHom_apply_le_sum_norm_coeff \u03c1 x\n\n/-- The universal seminorm is submultiplicative. -/\ntheorem universalSeminorm_mul_le (x y : MonoidAlgebra \u2102 (FreeGroup \u03b9)) :\n universalSeminorm \u03b9 (x * y) \u2264 universalSeminorm \u03b9 x * universalSeminorm \u03b9 y :=\n Seminorm.sSup_mul_le bddAbove_representationSeminorms (fun _ \u27e8_, _, _, _, \u03c1, hp\u27e9 x y => by\n simpa [hp] using norm_mul_le (\u03c1 x) (\u03c1 y)) x y\n\n/-- The universal seminorm is invariant under the involution. -/\n@[simp]\ntheorem universalSeminorm_star (x : MonoidAlgebra \u2102 (FreeGroup \u03b9)) :\n universalSeminorm \u03b9 (star x) = universalSeminorm \u03b9 x :=\n Seminorm.sSup_star bddAbove_representationSeminorms (fun _ \u27e8_, _, _, _, \u03c1, hp\u27e9 x => by\n simp [hp, map_star]) x\n\n/-- The universal seminorm satisfies the C\u22c6-identity `\u2016x\u22c6 * x\u2016\u1d64 = \u2016x\u2016\u1d64 * \u2016x\u2016\u1d64`. -/\ntheorem universalSeminorm_star_mul_self (x : MonoidAlgebra \u2102 (FreeGroup \u03b9)) :\n universalSeminorm \u03b9 (star x * x) = universalSeminorm \u03b9 x * universalSeminorm \u03b9 x :=\n Seminorm.sSup_star_mul_self bddAbove_representationSeminorms (fun _ \u27e8_, _, _, _, \u03c1, hp\u27e9 x => by\n simp [hp, map_star, CStarRing.norm_star_mul_self]) x\n\nend UniversalUnitaryCStarAlgebra\n\nopen UniversalUnitaryCStarAlgebra\n\nvariable (\u03b9 : Type u)\n\n/-- The group \u22c6-algebra `\u2102[F_\u03b9]` of the free group on `\u03b9`, with the universal C\u22c6-seminorm\n`universalSeminorm \u03b9` as its norm. Its completion is `UniversalUnitaryCStarAlgebra \u03b9`. Use\n`FreeUnitaryAlgebra.equiv` to pass to and from `MonoidAlgebra \u2102 (FreeGroup \u03b9)`. -/\n@[expose] def FreeUnitaryAlgebra : Type u :=\n MonoidAlgebra \u2102 (FreeGroup \u03b9)\n\nnamespace FreeUnitaryAlgebra\n\ninstance : Ring (FreeUnitaryAlgebra \u03b9) :=\n inferInstanceAs (Ring (MonoidAlgebra \u2102 (FreeGroup \u03b9)))\n\ninstance : Algebra \u2102 (FreeUnitaryAlgebra \u03b9) :=\n inferInstanceAs (Algebra \u2102 (MonoidAlgebra \u2102 (FreeGroup \u03b9)))\n\ninstance : StarRing (FreeUnitaryAlgebra \u03b9) :=\n inferInstanceAs (StarRing (MonoidAlgebra \u2102 (FreeGroup \u03b9)))\n\ninstance : StarModule \u2102 (FreeUnitaryAlgebra \u03b9) :=\n inferInstanceAs (StarModule \u2102 (MonoidAlgebra \u2102 (FreeGroup \u03b9)))\n\n/-- `FreeUnitaryAlgebra \u03b9` is `\u2102[F_\u03b9]` as a \u22c6-algebra. -/\ndef equiv : MonoidAlgebra \u2102 (FreeGroup \u03b9) \u2243\u22c6\u2090[\u2102] FreeUnitaryAlgebra \u03b9 :=\n StarAlgEquiv.refl \u2102 (MonoidAlgebra \u2102 (FreeGroup \u03b9))\n\n/-- The universal seminorm makes `\u2102[F_\u03b9]` a seminormed group. -/\ninstance : SeminormedAddCommGroup (FreeUnitaryAlgebra \u03b9) :=\n @AddGroupSeminorm.toSeminormedAddCommGroup (FreeUnitaryAlgebra \u03b9) _\n (universalSeminorm \u03b9).toAddGroupSeminorm\n\nvariable {\u03b9}\n\n/-- The norm of `FreeUnitaryAlgebra \u03b9` is the universal seminorm. -/\n@[simp]\ntheorem norm_equiv (x : MonoidAlgebra \u2102 (FreeGroup \u03b9)) : \u2016equiv \u03b9 x\u2016 = universalSeminorm \u03b9 x :=\n (rfl)\n\n/-- The norm of `FreeUnitaryAlgebra \u03b9` is the universal seminorm of the underlying element of\n`\u2102[F_\u03b9]`. -/\ntheorem norm_def (x : FreeUnitaryAlgebra \u03b9) : \u2016x\u2016 = universalSeminorm \u03b9 ((equiv \u03b9).symm x) :=\n (rfl)\n\n/-- The universal seminorm is submultiplicative, so `FreeUnitaryAlgebra \u03b9` is a seminormed\nring. -/\ninstance : SeminormedRing (FreeUnitaryAlgebra \u03b9) where\n __ : SeminormedAddCommGroup (FreeUnitaryAlgebra \u03b9) := inferInstance\n __ : Ring (FreeUnitaryAlgebra \u03b9) := inferInstance\n norm_mul_le := universalSeminorm_mul_le (\u03b9 := \u03b9)\n\ninstance : NormedAlgebra \u2102 (FreeUnitaryAlgebra \u03b9) where\n __ : Algebra \u2102 (FreeUnitaryAlgebra \u03b9) := inferInstance\n norm_smul_le c x := (map_smul_eq_mul (universalSeminorm \u03b9) c x).le\n\n/-- The involution is isometric for the universal seminorm. -/\ninstance : NormedStarGroup (FreeUnitaryAlgebra \u03b9) where\n norm_star_le x := (universalSeminorm_star (\u03b9 := \u03b9) x).le\n\n/-- The universal seminorm satisfies the C\u22c6-identity on `FreeUnitaryAlgebra \u03b9`. -/\ntheorem norm_star_mul_self (x : FreeUnitaryAlgebra \u03b9) : \u2016star x * x\u2016 = \u2016x\u2016 * \u2016x\u2016 :=\n universalSeminorm_star_mul_self (\u03b9 := \u03b9) x\n\nend FreeUnitaryAlgebra\n\n/-- **The universal unital C\u22c6-algebra on unitary generators indexed by `\u03b9`**: the completion of\nthe group \u22c6-algebra `\u2102[F_\u03b9]` of the free group on `\u03b9` in the universal C\u22c6-seminorm, the supremum\nover all unitary representations of `F_\u03b9`. For `\u03b9 = \u2115` it is `C*(F_\u221e)`. It is a unital\nC\u22c6-algebra with unitary generators `UniversalUnitaryCStarAlgebra.generator i`, and unital\n\u22c6-homomorphisms out of it are the families of unitaries indexed by `\u03b9`\n(`UniversalUnitaryCStarAlgebra.lift`). -/\n@[expose] def UniversalUnitaryCStarAlgebra : Type u :=\n Completion (FreeUnitaryAlgebra \u03b9)\n\nnamespace UniversalUnitaryCStarAlgebra\n\n/-- The completion of `\u2102[F_\u03b9]` in the universal seminorm is a unital C\u22c6-algebra. -/\ninstance instCStarAlgebra : CStarAlgebra (UniversalUnitaryCStarAlgebra \u03b9) :=\n letI : CStarAlgebra (Completion (FreeUnitaryAlgebra \u03b9)) :=\n { toCStarRing := Completion.cstarRing fun x => (FreeUnitaryAlgebra.norm_star_mul_self x).ge\n norm_smul_le := norm_smul_le }\n inferInstanceAs (CStarAlgebra (Completion (FreeUnitaryAlgebra \u03b9)))\n\n/-- The canonical unital \u22c6-homomorphism from `\u2102[F_\u03b9]` into the universal C\u22c6-algebra. -/\ndef of : MonoidAlgebra \u2102 (FreeGroup \u03b9) \u2192\u22c6\u2090[\u2102] UniversalUnitaryCStarAlgebra \u03b9 where\n toFun x := (FreeUnitaryAlgebra.equiv \u03b9 x : Completion (FreeUnitaryAlgebra \u03b9))\n map_one' := by\n rw [map_one]\n exact Completion.coe_one _\n map_mul' x y := by\n rw [map_mul]\n exact Completion.coe_mul' _ _\n map_zero' := by\n rw [map_zero]\n exact Completion.coe_zero\n map_add' x y := by\n rw [map_add]\n exact Completion.coe_add _ _\n commutes' r := by\n rw [AlgHomClass.commutes]\n exact (Completion.algebraMap_def _ _ r).symm\n map_star' x := by\n rw [map_star]\n exact Completion.coe_star _\n\nvariable {\u03b9}\n\n/-- The image of `x` under the completion map of `FreeUnitaryAlgebra \u03b9` is `of \u03b9 x`. -/\n@[simp]\ntheorem coe_equiv_eq_of (x : MonoidAlgebra \u2102 (FreeGroup \u03b9)) :\n ((FreeUnitaryAlgebra.equiv \u03b9 x : Completion (FreeUnitaryAlgebra \u03b9)) :\n UniversalUnitaryCStarAlgebra \u03b9) = of \u03b9 x :=\n (rfl)\n\n/-- The norm of the image of `x` in the universal C\u22c6-algebra is its universal seminorm. -/\n@[simp]\ntheorem norm_of (x : MonoidAlgebra \u2102 (FreeGroup \u03b9)) : \u2016of \u03b9 x\u2016 = universalSeminorm \u03b9 x :=\n (Completion.norm_coe (FreeUnitaryAlgebra.equiv \u03b9 x)).trans (FreeUnitaryAlgebra.norm_equiv x)\n\n/-- `\u2102[F_\u03b9]` is dense in the universal C\u22c6-algebra. -/\ntheorem denseRange_of : DenseRange (of \u03b9) :=\n Completion.denseRange_coe.comp (FreeUnitaryAlgebra.equiv \u03b9).surjective.denseRange\n (Completion.continuous_coe _)\n\n/-- To prove a closed property of every element of the universal C\u22c6-algebra, it suffices to\nprove it on `\u2102[F_\u03b9]`. -/\n@[elab_as_elim]\ntheorem induction_on {p : UniversalUnitaryCStarAlgebra \u03b9 \u2192 Prop}\n (x : UniversalUnitaryCStarAlgebra \u03b9) (hp : IsClosed {x | p x}) (ih : \u2200 x, p (of \u03b9 x)) :\n p x :=\n Completion.induction_on (p := p) x hp fun y => by\n have h := ih ((FreeUnitaryAlgebra.equiv \u03b9).symm y)\n rwa [\u2190 coe_equiv_eq_of, StarAlgEquiv.apply_symm_apply] at h\n\nvariable {B : Type w} [CStarAlgebra B]\n\nopen scoped _root_.CStarAlgebra in\n/-- Unital \u22c6-homomorphisms out of the universal C\u22c6-algebra are determined on `\u2102[F_\u03b9]`. -/\ntheorem starAlgHom_ext {\u03c6 \u03c8 : UniversalUnitaryCStarAlgebra \u03b9 \u2192\u22c6\u2090[\u2102] B}\n (h : \u03c6.comp (of \u03b9) = \u03c8.comp (of \u03b9)) : \u03c6 = \u03c8 :=\n StarAlgHom.ext fun x => induction_on x (isClosed_eq (map_continuous \u03c6) (map_continuous \u03c8))\n fun y => congr($h y)\n\n/-- Extend a unital \u22c6-homomorphism from `\u2102[F_\u03b9]` into a unital C\u22c6-algebra to the universal\nC\u22c6-algebra. It is bounded by the universal seminorm, `norm_apply_le_universalSeminorm`. -/\ndef extend (\u03c6 : MonoidAlgebra \u2102 (FreeGroup \u03b9) \u2192\u22c6\u2090[\u2102] B) :\n UniversalUnitaryCStarAlgebra \u03b9 \u2192\u22c6\u2090[\u2102] B :=\n (\u03c6.comp (FreeUnitaryAlgebra.equiv \u03b9).symm.toStarAlgHom).fromCompletion <|\n AddMonoidHomClass.continuous_of_bound _ 1 fun x => by\n simpa [FreeUnitaryAlgebra.norm_def] using\n norm_apply_le_universalSeminorm \u03c6 ((FreeUnitaryAlgebra.equiv \u03b9).symm x)\n\n/-- The extension agrees with the original \u22c6-homomorphism on `\u2102[F_\u03b9]`. -/\n@[simp]\ntheorem extend_of (\u03c6 : MonoidAlgebra \u2102 (FreeGroup \u03b9) \u2192\u22c6\u2090[\u2102] B)\n (x : MonoidAlgebra \u2102 (FreeGroup \u03b9)) : extend \u03c6 (of \u03b9 x) = \u03c6 x := by\n rw [\u2190 coe_equiv_eq_of]\n -- `extend \u03c6` is by definition the extension from the completion of `FreeUnitaryAlgebra \u03b9`.\n exact (StarAlgHom.fromCompletion_apply_coe _ _ (FreeUnitaryAlgebra.equiv \u03b9 x)).trans (by simp)\n\nvariable (\u03b9) in\n/-- The unitary generator of the universal C\u22c6-algebra indexed by `i`: the image of the free\ngenerator `FreeGroup.of i`. -/\ndef generator (i : \u03b9) : unitary (UniversalUnitaryCStarAlgebra \u03b9) :=\n \u27e8of \u03b9 (single (FreeGroup.of i) 1), Unitary.map_mem (of \u03b9) (single_one_mem_unitary _)\u27e9\n\ntheorem coe_generator (i : \u03b9) :\n (generator \u03b9 i : UniversalUnitaryCStarAlgebra \u03b9) = of \u03b9 (single (FreeGroup.of i) 1) :=\n (rfl)\n\n/-- **Unital \u22c6-homomorphisms out of the universal C\u22c6-algebra are determined by their values on\nthe generators.** -/\n@[ext]\ntheorem hom_ext {\u03c6 \u03c8 : UniversalUnitaryCStarAlgebra \u03b9 \u2192\u22c6\u2090[\u2102] B}\n (h : \u2200 i, \u03c6 (generator \u03b9 i) = \u03c8 (generator \u03b9 i)) : \u03c6 = \u03c8 := by\n refine starAlgHom_ext ((starLift \u2102 (FreeGroup \u03b9) B).symm.injective (FreeGroup.ext_hom _ _ fun i =>\n Subtype.ext ?_))\n simpa [coe_generator] using h i\n\nvariable (\u03b9 B) in\n/-- **The universal property of the universal C\u22c6-algebra on unitary generators.** Unital\n\u22c6-homomorphisms into a unital C\u22c6-algebra `B`, in any universe, are the families of unitaries of\n`B` indexed by `\u03b9`: a family `u` gives the unique unital \u22c6-homomorphism sending `generator \u03b9 i`\nto `u i`, and a \u22c6-homomorphism restricts to its values on the generators. -/\ndef lift : (\u03b9 \u2192 unitary B) \u2243 (UniversalUnitaryCStarAlgebra \u03b9 \u2192\u22c6\u2090[\u2102] B) where\n toFun u := extend (starLift \u2102 (FreeGroup \u03b9) B (FreeGroup.lift u))\n invFun \u03c6 i := \u27e8\u03c6 (generator \u03b9 i), Unitary.map_mem \u03c6 (generator \u03b9 i).property\u27e9\n left_inv u := funext fun i => Subtype.ext (by simp [coe_generator])\n right_inv \u03c6 := hom_ext fun i => by simp [coe_generator]\n\n/-- On `\u2102[F_\u03b9]`, the \u22c6-homomorphism given by a family of unitaries is the \u22c6-homomorphism of the\ngroup \u22c6-algebra given by the free group homomorphism it induces. -/\n@[simp]\ntheorem lift_of (u : \u03b9 \u2192 unitary B) (x : MonoidAlgebra \u2102 (FreeGroup \u03b9)) :\n lift \u03b9 B u (of \u03b9 x) = starLift \u2102 (FreeGroup \u03b9) B (FreeGroup.lift u) x :=\n extend_of _ x\n\n/-- The \u22c6-homomorphism given by a family of unitaries sends each generator to its unitary. -/\n@[simp]\ntheorem lift_generator (u : \u03b9 \u2192 unitary B) (i : \u03b9) :\n lift \u03b9 B u (generator \u03b9 i) = u i := by\n simp [coe_generator]\n\n@[simp]\ntheorem lift_symm_apply_coe (\u03c6 : UniversalUnitaryCStarAlgebra \u03b9 \u2192\u22c6\u2090[\u2102] B) (i : \u03b9) :\n ((lift \u03b9 B).symm \u03c6 i : B) = \u03c6 (generator \u03b9 i) :=\n (rfl)\n\n/-- The universal C\u22c6-algebra on unitary generators is nontrivial: sending every generator to `1`\ngives a unital \u22c6-homomorphism onto `\u2102`. -/\ninstance : Nontrivial (UniversalUnitaryCStarAlgebra \u03b9) := by\n refine \u27e8\u27e81, 0, fun h => ?_\u27e9\u27e9\n simpa using congr(lift \u03b9 \u2102 (fun _ => 1) $h)\n\n/-- `\u2102[F_\u03b9]` lies in the span of the group elements in the universal C\u22c6-algebra. -/\ntheorem range_of_subset_span :\n Set.range (of \u03b9) \u2286 Submodule.span \u2102 (Set.range fun g : FreeGroup \u03b9 => of \u03b9 (single g 1)) := by\n rintro _ \u27e8x, rfl\u27e9\n rw [\u2190 sum_coeff_single x, Finsupp.sum, map_sum]\n refine Submodule.sum_mem _ fun g _ => ?_\n rw [\u2190 smul_single_one, map_smul]\n exact Submodule.smul_mem _ _ (Submodule.subset_span \u27e8g, rfl\u27e9)\n\n/-- The group elements span a dense subspace of the universal C\u22c6-algebra. -/\ntheorem dense_span_range_of_single :\n Dense (Submodule.span \u2102 (Set.range fun g : FreeGroup \u03b9 => of \u03b9 (single g 1)) :\n Set (UniversalUnitaryCStarAlgebra \u03b9)) :=\n denseRange_of.mono range_of_subset_span\n\n", "statement": "/-- **The generators generate the universal C\u22c6-algebra**: the closure of the \u22c6-subalgebra they\ngenerate is everything. -/\ntheorem topologicalClosure_adjoin_range_generator :\n StarSubalgebra.topologicalClosure\n (StarAlgebra.adjoin \u2102 (Set.range fun i => (generator \u03b9 i : UniversalUnitaryCStarAlgebra \u03b9)))\n = \u22a4 ", "proof": " by\n have hs := StarAlgebra.subset_adjoin \u2102\n (Set.range fun i => (generator \u03b9 i : UniversalUnitaryCStarAlgebra \u03b9))\n generalize StarAlgebra.adjoin \u2102\n (Set.range fun i => (generator \u03b9 i : UniversalUnitaryCStarAlgebra \u03b9)) = S at hs \u22a2\n -- Every group element lies in `S`: the generators and their adjoints do.\n have hg (g : FreeGroup \u03b9) : of \u03b9 (single g 1) \u2208 S := by\n induction g using FreeGroup.induction_on with\n | one => simp [\u2190 one_def]\n | of i => exact hs \u27e8i, rfl\u27e9\n | inv_of i _ => simpa [coe_generator, \u2190 map_star] using star_mem (hs \u27e8i, rfl\u27e9)\n | mul g h hg hh => simpa [\u2190 map_mul, single_mul_single] using S.mul_mem hg hh\n have hS : (Submodule.span \u2102 (Set.range fun g : FreeGroup \u03b9 => of \u03b9 (single g 1)) :\n Set (UniversalUnitaryCStarAlgebra \u03b9)) \u2286 S :=\n Submodule.span_le (p := S.toSubalgebra.toSubmodule).2 (Set.range_subset_iff.2 hg)\n exact eq_top_iff.2 fun x _ => closure_mono hS (dense_span_range_of_single x)", "proof_lines": 15, "proof_length": 825, "rev": "75c8aed5fea63047615a25a9763fd5b68a86e891", "heartbeats": 1805, "image": "lean-compression:tauceti-75c8aed5fe-a608030cfc", "split": "dev"} {"path": "TauCeti/Analysis/Complex/UpperHalfPlane/Geodesic/Angle.lean", "module": "TauCeti.Analysis.Complex.UpperHalfPlane.Geodesic.Angle", "theorem": "TauCeti.UpperHalfPlane.velocity_mul_dilation", "prefix": "/-\nCopyright (c) 2026 The Tau Ceti contributors. All rights reserved.\nReleased under Apache 2.0 license as described in the file LICENSE.\nAuthors: The Tau Ceti contributors\n-/\nmodule\n\npublic import Mathlib.Analysis.Complex.Angle\npublic import TauCeti.Analysis.Complex.UpperHalfPlane.Geodesic\npublic import TauCeti.Analysis.Complex.UpperHalfPlane.Rotation\npublic import TauCeti.Analysis.Complex.UpperHalfPlane.SmulDeriv\n\n/-!\n# Velocities of geodesic lines and the angle between two geodesics\n\nThe velocity `velocity g t` of the geodesic line `geodesicLine g` at parameter `t` is the\nderivative of `t \u21a6 (geodesicLine g t : \u2102)`; it is the derivative of the M\u00f6bius map of `g`\napplied to the vertical velocity `I * exp t` (`hasDerivAt_coe_geodesicLine`, `velocity_mul`).\nThe angle `geodesicAngle g\u2081 g\u2082` between two geodesic lines starting at the same point is the\nEuclidean angle between their velocities at parameter `0`. Since M\u00f6bius transformations act on\nvelocities by multiplication by the nonzero complex number `smulDeriv`, the angle is invariant\nunder the action (`geodesicAngle_mul`): this is the conformality of `PSL(2, \u211d)`.\n\nSource: Katok, *Fuchsian groups, geodesic flows\u2026*, Clay Math. Proc. 10 (2010): the definition of\nthe angle between geodesics as the angle between tangent vectors, \u00a72 p. 7; Theorem 5.1 and\nCorollary 5.2 (M\u00f6bius transformations preserve the norm on tangent spaces, hence angles), p. 17\u201318.\n-/\n\npublic section\n\nnoncomputable section\n\nopen Matrix.ProjectiveSpecialLinearGroup UpperHalfPlane\nopen scoped MatrixGroups Real\n\nnamespace TauCeti.UpperHalfPlane\n\nopen Matrix.SpecialLinearGroup (rotation dilation)\n\n/-! ### Velocities -/\n\n/-- The velocity of the geodesic line `geodesicLine g` at parameter `t`: the derivative of\n`t \u21a6 (geodesicLine g t : \u2102)`, see `hasDerivAt_coe_geodesicLine`. -/\ndef velocity (g : PSL(2, \u211d)) (t : \u211d) : \u2102 :=\n smulDeriv g (geodesicLine 1 t) * (Complex.I * Real.exp t)\n\n-- The body of `velocity` is not `@[expose]`d, so downstream modules rewrite with this equation.\n/-- `velocity` is the derivative of the M\u00f6bius map applied to the vertical velocity `I * exp t`. -/\ntheorem velocity_def (g : PSL(2, \u211d)) (t : \u211d) :\n velocity g t = smulDeriv g (geodesicLine 1 t) * (Complex.I * Real.exp t) := by rfl\n\n/-- `velocity g t` is the derivative of the geodesic line `geodesicLine g`, as a curve in `\u2102`. -/\ntheorem hasDerivAt_coe_geodesicLine (g : PSL(2, \u211d)) (t : \u211d) :\n HasDerivAt (fun s : \u211d \u21a6 (geodesicLine g s : \u2102)) (velocity g t) t := by\n -- the vertical axis `s \u21a6 I * exp s`, then the M\u00f6bius map of `g`\n have hax : HasDerivAt (fun s : \u211d \u21a6 ((geodesicLine 1 s : \u210d) : \u2102)) (Complex.I * Real.exp t) t := by\n have h : (fun s : \u211d \u21a6 ((geodesicLine 1 s : \u210d) : \u2102)) =\n fun s : \u211d \u21a6 Complex.I * (Real.exp s : \u2102) := by\n funext s\n rw [geodesicLine_one_apply, UpperHalfPlane.coe_mk]\n simp [Complex.ext_iff, Complex.exp_ofReal_re]\n rw [h]\n exact (Real.hasDerivAt_exp t).ofReal_comp.const_mul Complex.I\n have hfun : (fun s : \u211d \u21a6 (geodesicLine g s : \u2102)) =\n (fun w : \u2102 \u21a6 ((g \u2022 ofComplex w : \u210d) : \u2102)) \u2218 fun s : \u211d \u21a6 ((geodesicLine 1 s : \u210d) : \u2102) := by\n funext s\n simp only [Function.comp_apply, ofComplex_apply, smul_geodesicLine, mul_one]\n rw [hfun, velocity, mul_comm]\n exact (hasStrictDerivAt_coe_smul g (geodesicLine 1 t)).hasDerivAt.scomp t hax\n\n/-- Geodesic lines are regular curves: their velocity never vanishes. -/\n@[simp]\ntheorem velocity_ne_zero (g : PSL(2, \u211d)) (t : \u211d) : velocity g t \u2260 0 :=\n mul_ne_zero (smulDeriv_ne_zero g _)\n (mul_ne_zero Complex.I_ne_zero (Complex.ofReal_ne_zero.2 (Real.exp_pos t).ne'))\n\n/-- The velocity of the upward imaginary axis `t \u21a6 i exp t`. -/\n@[simp]\ntheorem velocity_one (t : \u211d) : velocity 1 t = Complex.I * Real.exp t := by\n rw [velocity, smulDeriv_one, one_mul]\n\n/-- The chain rule: translating a geodesic line by `h` multiplies its velocity by the derivative\nof the M\u00f6bius map of `h` at the point. -/\ntheorem velocity_mul (h g : PSL(2, \u211d)) (t : \u211d) :\n velocity (h * g) t = smulDeriv h (geodesicLine g t) * velocity g t := by\n have hg : geodesicLine g t = g \u2022 geodesicLine 1 t := by rw [smul_geodesicLine, mul_one]\n rw [velocity, velocity, smulDeriv_mul, hg, mul_assoc]\n\n/-- Reversing a geodesic line negates its velocity. -/\ntheorem velocity_mul_pslS (g : PSL(2, \u211d)) (t : \u211d) : velocity (g * pslS) t = -velocity g (-t) := by\n have h1 := hasDerivAt_coe_geodesicLine (g * pslS) t\n have h2 : HasDerivAt (fun s : \u211d \u21a6 (geodesicLine (g * pslS) s : \u2102)) (-velocity g (-t)) t := by\n have h : (fun s : \u211d \u21a6 (geodesicLine (g * pslS) s : \u2102)) =\n (fun s : \u211d \u21a6 (geodesicLine g s : \u2102)) \u2218 Neg.neg := by\n funext s\n simp [geodesicLine_mul_pslS]\n rw [h]\n simpa using (hasDerivAt_coe_geodesicLine g (-t)).scomp t (hasDerivAt_neg t)\n exact h1.unique h2\n\n", "statement": "/-- Shifting the parameter of a geodesic line shifts its velocity. -/\ntheorem velocity_mul_dilation (g : PSL(2, \u211d)) (s t : \u211d) :\n velocity (g * \u2191(dilation s)) t = velocity g (s + t) ", "proof": " by\n have h1 := hasDerivAt_coe_geodesicLine (g * \u2191(dilation s)) t\n have h2 : HasDerivAt (fun u : \u211d \u21a6 (geodesicLine (g * \u2191(dilation s)) u : \u2102))\n (velocity g (s + t)) t := by\n have h : (fun u : \u211d \u21a6 (geodesicLine (g * \u2191(dilation s)) u : \u2102)) =\n (fun u : \u211d \u21a6 (geodesicLine g u : \u2102)) \u2218 (s + \u00b7) := by\n funext u\n simp [geodesicLine_mul_dilation]\n rw [h]\n simpa using (hasDerivAt_coe_geodesicLine g (s + t)).scomp t ((hasDerivAt_id' t).const_add s)\n exact h1.unique h2", "proof_lines": 10, "proof_length": 448, "rev": "75c8aed5fea63047615a25a9763fd5b68a86e891", "heartbeats": 921, "image": "lean-compression:tauceti-75c8aed5fe-a608030cfc", "split": "dev"} {"path": "TauCeti/RepresentationTheory/Homological/ContCohomology/CohomologicalDimension/ClassModule/Quotient.lean", "module": "TauCeti.RepresentationTheory.Homological.ContCohomology.CohomologicalDimension.ClassModule.Quotient", "theorem": "TauCeti.abelianizationProPExtensionKernel_le_of_isPGroup_map", "prefix": "/-\nCopyright (c) 2026 The Tau Ceti contributors. All rights reserved.\nReleased under Apache 2.0 license as described in the file LICENSE.\nAuthors: The Tau Ceti contributors\n-/\nmodule\n\npublic import TauCeti.RepresentationTheory.Homological.ContCohomology.CohomologicalDimension.ClassModule.Extension\nimport TauCeti.Topology.Algebra.Group.TopologicalAbelianization.MaximalProP\n\n/-!\n# Quotients of a pro-`p` class-module extension\n\nLet `V` be a subgroup of a topological group `G`. A continuous homomorphism from `G` to a profinite\ngroup kills the kernel of `V \u2192 V\u1d43\u1d47(p)` as soon as it maps `V` into a closed abelian pro-`p`\nsubgroup (`TauCeti.abelianizationProPExtensionKernel_le_ker`). When `V` is normal, the\nhomomorphism therefore factors through the class-module extension `G / ker(V \u2192 V\u1d43\u1d47(p))`.\n\nThe two instances used are a profinite extension whose kernel is an abelian pro-`p` group, into\nwhich a free presentation maps its relation subgroup, and a discrete quotient `G/U` (for instance\na finite one) in which the image of `V` is an abelian `p`-group\n(`TauCeti.abelianizationProPExtensionKernel_le_of_isPGroup_map`). The latter permits a generating\nfamily of the class-module extension to be read in that quotient.\n\n## References\n\n* J. Neukirch, A. Schmidt and K. Wingberg, *Cohomology of Number Fields*, 2nd ed.,\n proof of (7.4.1).\n-/\n\npublic section\n\nnamespace TauCeti\n\nopen scoped IsMulCommutative\n\nvariable {G : Type*} [Group G] [TopologicalSpace G] [IsTopologicalGroup G]\n\n/-- A continuous homomorphism to a profinite group which maps `V` into a closed abelian pro-`p`\nsubgroup `A` kills the kernel of `V \u2192 V\u1d43\u1d47(p)`. -/\ntheorem abelianizationProPExtensionKernel_le_ker (p : \u2115) (V : Subgroup G) {E : Type*} [Group E]\n [TopologicalSpace E] [IsTopologicalGroup E] [CompactSpace E] [TotallyDisconnectedSpace E]\n (\u03c6 : G \u2192\u209c* E) (A : Subgroup E) [IsMulCommutative A] (hA : IsClosed (A : Set E))\n (hpro : IsProP p A) (hVA : V \u2264 A.comap \u03c6) :\n abelianizationProPExtensionKernel p G V \u2264 (\u03c6 : G \u2192* E).ker := by\n have : CompactSpace A := isCompact_iff_compactSpace.mp hA.isCompact\n let f : V \u2192\u209c* A :=\n \u27e8((\u03c6 : G \u2192* E).comp V.subtype).codRestrict A fun v \u21a6 hVA v.property,\n ((map_continuous \u03c6).comp continuous_subtypeVal).subtype_mk _\u27e9\n intro x hx\n obtain \u27e8hv, hzero\u27e9 := (mem_abelianizationProPExtensionKernel_iff p G V x).mp hx\n rw [abelianizationProPMk_apply] at hzero\n exact congrArg Subtype.val (eq_one_of_maximalProPQuotient_mk_eq_one hpro f hzero)\n\n\n", "statement": "/-- A discrete quotient in which the image of `V` is an abelian `p`-group kills the kernel\nof `V \u2192 V\u1d43\u1d47(p)`. For normal `V`, this is the inclusion needed by `QuotientGroup.mapOfLE`\nto factor the quotient through the pro-`p` class-module extension. -/\ntheorem abelianizationProPExtensionKernel_le_of_isPGroup_map (p : \u2115)\n (V : Subgroup G) (U : OpenNormalSubgroup G)\n (hpro : IsPGroup p (V.map (QuotientGroup.mk' U.toSubgroup)))\n (hcomm : \u2045V, V\u2046 \u2264 U.toSubgroup) :\n abelianizationProPExtensionKernel p G V \u2264 U.toSubgroup ", "proof": " by\n have : DiscreteTopology (G \u29f8 U.toSubgroup) := QuotientGroup.discreteTopology U.isOpen\n let H := V.map (QuotientGroup.mk' U.toSubgroup)\n have hHcomm : \u2045H, H\u2046 = \u22a5 := by\n rw [\u2190 Subgroup.map_commutator]\n exact (Subgroup.map_eq_bot_iff _).mpr (by simpa using hcomm)\n have : IsMulCommutative H := Subgroup.commutator_self_eq_bot_iff.mp hHcomm\n let f : V \u2192\u209c* H :=\n \u27e8((QuotientGroup.mk' U.toSubgroup).comp V.subtype).codRestrict H fun v \u21a6 \u27e8v, v.property, rfl\u27e9,\n ((continuous_quotient_mk'.comp continuous_subtypeVal).subtype_mk _)\u27e9\n let fab := TopologicalAbelianization.lift f\n let N : OpenNormalSubgroup (TopologicalAbelianization V) :=\n \u27e8\u27e8(fab : TopologicalAbelianization V \u2192* H).ker,\n (isOpen_discrete {(1 : H)}).preimage fab.continuous\u27e9, inferInstance\u27e9\n have hN : IsPGroup p (TopologicalAbelianization V \u29f8 N.toSubgroup) :=\n (hpro.to_subgroup (fab : TopologicalAbelianization V \u2192* H).range).of_equiv\n (QuotientGroup.quotientKerEquivRange _).symm\n intro x hx\n obtain \u27e8hv, hzero\u27e9 := (mem_abelianizationProPExtensionKernel_iff p G V x).mp hx\n rw [abelianizationProPMk_apply] at hzero\n have h2 : ((\u27e8x, hv\u27e9 : V) : TopologicalAbelianization V) \u2208 N.toSubgroup :=\n proPKernel_le hN ((QuotientGroup.eq_one_iff _).mp hzero)\n have h3 : f \u27e8x, hv\u27e9 = 1 := (TopologicalAbelianization.lift_mk f \u27e8x, hv\u27e9).symm.trans h2\n exact (QuotientGroup.eq_one_iff x).mp (congrArg Subtype.val h3)", "proof_lines": 23, "proof_length": 1341, "rev": "75c8aed5fea63047615a25a9763fd5b68a86e891", "heartbeats": 4715, "image": "lean-compression:tauceti-75c8aed5fe-a608030cfc", "split": "dev"} {"path": "TauCeti/RepresentationTheory/Quiver/Zigzag/Componentwise/Hom.lean", "module": "TauCeti.RepresentationTheory.Quiver.Zigzag.Componentwise.Hom", "theorem": "TauCeti.coe_zigzagAlgebraGradedProjectiveHomEquivCorner_apply", "prefix": "/-\nCopyright (c) 2026 The Tau Ceti contributors. All rights reserved.\nReleased under Apache 2.0 license as described in the file LICENSE.\nAuthors: The Tau Ceti contributors, Wentao Li\n-/\nmodule\n\npublic import TauCeti.RepresentationTheory.Quiver.Zigzag.Componentwise.Corner.Trace\npublic import TauCeti.RepresentationTheory.Quiver.Zigzag.Componentwise.Projective\n\n/-!\n# Shifted projective homomorphisms and the componentwise trace\n\nEvaluation at the vertex idempotent identifies graded maps `P_i \u27f6 P_j{s}` with the degree\n`-s` part of the corner `e_i Z e_j`. The inverse is right multiplication by the corner vector.\nComposition, with the target shift applied to the second map, corresponds to multiplication of\nthese vectors in the public componentwise zigzag algebra.\n\nThe corner trace pairing therefore pairs `Hom(P_i, P_j{s})` perfectly with\n`Hom(P_j, P_i{-2-s})`. Its value is the trace of the composed underlying module map evaluated\nat the vertex generator. All shifts here are internal grading shifts.\n\nThe dictionary uses the existing graded idempotent evaluation equivalence\n`TauCeti.GradedModuleCat.ofIdealSpanSingletonHomEquiv` and its corner-piece calculation.\nPerfectness is transported from the signed graded corner pairing using Mathlib's\n`LinearMap.IsPerfPair.compl\u2081\u2082`; the induced dual equivalence is `LinearMap.toPerfPair`.\n\n## References\n\n* Huerfano--Khovanov, *A category for the adjoint representation*, Sections 3 and 4.6.\n* Ehrig--Tubbenhauer, *Algebraic properties of zigzag algebras*, Section 2.\n-/\n\npublic section\nnoncomputable section\n\nnamespace TauCeti\n\nopen CategoryTheory\nopen scoped Pointwise\n\nuniverse u w\n\nvariable (k : Type w) [CommRing k] {V : Type u} [Finite V] (G : SimpleGraph V)\n\nlocal notation \"Z\" => AlgCat.carrier (zigzagAlgebra k G)\nlocal notation \"e\" => fun i : V \u21a6 zigzagAlgebraBasis k G (Sum.inl i)\nlocal notation \"A\" => zigzagAlgebraIntegerGrade k G\nlocal notation \"P\" => zigzagAlgebraGradedProjective k G\nlocal notation \"C\" => fun (i j : V) (d : \u2124) \u21a6 cornerSubmodule k (e i) (e j) \u2293 A d\nlocal notation \"H\" => fun (i j : V) (s : \u2124) \u21a6 P i \u27f6 GradedModuleCat.shiftObj (P j) s\n\nprivate theorem map_shifted_projective_zero (i j : V) (s : \u2124) :\n (e i \u2022 ((P j).shiftObj s).grading.piece 0).map\n ((Ideal.span {e j} : Ideal Z).subtype.restrictScalars k) = C i j (-s) := by\n let _ := zigzagAlgebraIntegerGradedAlgebra k G\n have hpiece : ((P j).shiftObj s).grading.piece 0 = (P j).grading.piece (-s) := by\n ext x\n rw [GradedModuleCat.mem_shiftObj_piece_iff, zero_sub]\n rw [hpiece]\n exact GradedModuleCat.map_subtype_smul_ofIdeal_span_singleton_piece\n (zigzagAlgebraBasis_inl_mem_integerGrade_zero k G i)\n (isHomogeneous_span_zigzagAlgebraBasis_inl k G j) (-s)\n\n/-- Evaluation at the vertex generator identifies maps into internal shift `s` with the signed\ndegree-`(-s)` corner of the public componentwise algebra. -/\ndef zigzagAlgebraGradedProjectiveHomEquivCorner (i j : V) (s : \u2124) :\n H i j s \u2243\u2097[k] \u21a5(C i j (-s)) :=\n let _ := zigzagAlgebraIntegerGradedAlgebra k G\n (GradedModuleCat.ofIdealSpanSingletonHomEquiv\n (isIdempotentElem_zigzagAlgebraBasis_inl k G i)\n (zigzagAlgebraBasis_inl_mem_integerGrade_zero k G i)\n (isHomogeneous_span_zigzagAlgebraBasis_inl k G i) ((P j).shiftObj s)).trans\n ((Submodule.equivMapOfInjective\n ((Ideal.span {e j} : Ideal Z).subtype.restrictScalars k)\n (fun _ _ h \u21a6 Subtype.ext h) _).trans\n (LinearEquiv.ofEq _ _ (map_shifted_projective_zero k G i j s)))\n\n", "statement": "/-- The corner vector of a shifted graded map is its value at the source vertex generator. -/\n@[simp]\ntheorem coe_zigzagAlgebraGradedProjectiveHomEquivCorner_apply (i j : V) (s : \u2124)\n (f : H i j s) :\n (zigzagAlgebraGradedProjectiveHomEquivCorner k G i j s f : Z) =\n (f.hom (spanSingletonGenerator (e i)) : Z) ", "proof": " by\n let _ := zigzagAlgebraIntegerGradedAlgebra k G\n -- Keep the restricted-scalar grading intact while composing the two ambient computations.\n exact (Submodule.coe_equivMapOfInjective_apply\n ((Ideal.span {e j} : Ideal Z).subtype.restrictScalars k) (fun _ _ h \u21a6 Subtype.ext h)\n (e i \u2022 ((P j).shiftObj s).grading.piece 0)\n (GradedModuleCat.ofIdealSpanSingletonHomEquiv\n (isIdempotentElem_zigzagAlgebraBasis_inl k G i)\n (zigzagAlgebraBasis_inl_mem_integerGrade_zero k G i)\n (isHomogeneous_span_zigzagAlgebraBasis_inl k G i) ((P j).shiftObj s) f)).trans\n (congrArg (fun x : (P j).shiftObj s \u21a6 (x : Z))\n (GradedModuleCat.coe_ofIdealSpanSingletonHomEquiv_apply\n (isIdempotentElem_zigzagAlgebraBasis_inl k G i)\n (zigzagAlgebraBasis_inl_mem_integerGrade_zero k G i)\n (isHomogeneous_span_zigzagAlgebraBasis_inl k G i) f))", "proof_lines": 14, "proof_length": 708, "rev": "75c8aed5fea63047615a25a9763fd5b68a86e891", "heartbeats": 1810, "image": "lean-compression:tauceti-75c8aed5fe-a608030cfc", "split": "dev"} {"path": "TauCeti/Geometry/Manifold/Morse/GradientFlow.lean", "module": "TauCeti.Geometry.Manifold.Morse.GradientFlow", "theorem": "TauCeti.comp_maximalIntegralCurve_neg_mgradient_le_sub_mul", "prefix": "/-\nCopyright (c) 2026 The Tau Ceti contributors. All rights reserved.\nReleased under Apache 2.0 license as described in the file LICENSE.\nAuthors: The Tau Ceti contributors\n-/\nmodule\n\npublic import Mathlib.MeasureTheory.Integral.IntegralEqImproper\npublic import TauCeti.Geometry.Manifold.IntegralCurve.Flow\npublic import TauCeti.Geometry.Manifold.Morse.CriticalPoints\npublic import TauCeti.Geometry.Manifold.Riemannian.Energy\npublic import TauCeti.Geometry.Manifold.Riemannian.Gradient.Basic\nimport TauCeti.Geometry.Manifold.IntegralCurve.Regularity\nimport TauCeti.Geometry.Manifold.MFDeriv.Curve\nimport TauCeti.Geometry.Manifold.Riemannian.Basic\nimport TauCeti.Topology.OmegaLimit\nimport TauCeti.Topology.Order.Monotone.Convergence\n\n/-!\n# Convergence of negative gradient trajectories trapped in a compact set\n\nLet `f` be a `C\u00b2` function on a boundaryless finite-dimensional manifold `M` carrying a `C\u00b9`\nRiemannian metric, and let `\u03b3` be the maximal integral curve of the negative gradient `-grad f`\nthrough a point `x`. Neither `M` nor the sublevels of `f` need be compact, and the metric need not\nbe complete. Along `\u03b3` the function `f` decreases with derivative `-\u2016grad f\u2016\u00b2`\n(`TauCeti.hasDerivAt_comp_maximalIntegralCurve_neg_mgradient`); this is the energy dissipation\nidentity, whose integrated form identifies the total energy `\u222b \u2016grad f (\u03b3 t)\u2016\u00b2 dt` with the drop\nof `f` (`TauCeti.integral_Ioi_norm_mgradient_sq_maximalIntegralCurve`).\n\nSuppose that the forward trajectory of `x` stays in a compact set `K`. Then it exists for all\npositive time, every cluster point of `\u03b3 t` as `t \u2192 \u221e` is a critical point of `f`, and if `K`\ncontains only finitely many critical points the trajectory converges to one of them\n(`TauCeti.exists_tendsto_maximalIntegralCurve_neg_mgradient`). This is the manifold counterpart,\nfor an arbitrary Riemannian metric, of the vector-space theorem\n`IsIntegralCurveOn.exists_tendsto_atTop`. The \u03c9-limit set of the trajectory is nonempty,\nconnected and invariant under the local flow, and `f` is constant on it, so the gradient vanishes\nthere.\n\nA trajectory cannot linger where the gradient is long. If `\u2016grad f\u2016\u00b2 \u2265 c` along `\u03b3` on `[0, t]`,\nthen `f (\u03b3 t) \u2264 f x - c t` (`TauCeti.comp_maximalIntegralCurve_neg_mgradient_le_sub_mul`). Hence\nif `\u2016grad f\u2016\u00b2 \u2265 c` on a band `f\u207b\u00b9[a, b]` and `f x \u2264 b`, then `f (\u03b3 t) < a` as soon as\n`c t > b - a` (`TauCeti.comp_maximalIntegralCurve_neg_mgradient_lt`). On a compact band without\ncritical points `\u2016grad f\u2016\u00b2` has a positive lower bound, so the trajectories of all points of\n`{f \u2264 b}` pass below `a` within a common time\n(`TauCeti.exists_forall_comp_maximalIntegralCurve_neg_mgradient_lt`). No nondegeneracy is\ninvolved: only the critical points in the band matter, not their type elsewhere.\n\nA proper Morse function bounded below traps each forward trajectory in its initial compact\nsublevel, so every forward negative gradient trajectory of such a function converges to a critical\npoint (`TauCeti.IsMorse.exists_tendsto_maximalIntegralCurve_neg_mgradient`). The metric is\narbitrary: it need not be adapted to the Morse charts of `f`.\n\n## Main declarations\n\n* `TauCeti.contMDiffOn_maximalIntegralCurve_neg_mgradient`: a negative gradient trajectory is\n `C\u00b9` on its interval of definition.\n* `TauCeti.curveVelocity_maximalIntegralCurve_neg_mgradient`: the velocity of a negative\n gradient trajectory is `-grad f`.\n* `TauCeti.maximalIntegralCurve_neg_mgradient_neg`: a global negative gradient trajectory of `f`\n run backwards is the negative gradient trajectory of `-f`.\n* `TauCeti.maximalIntegralCurve_neg_mgradient_neg_of_nonpos`: the same for negative times, when\n the trajectory of `f` is only defined for all positive time.\n* `TauCeti.hasDerivAt_comp_maximalIntegralCurve_neg_mgradient` and\n `TauCeti.antitoneOn_comp_maximalIntegralCurve_neg_mgradient`: energy dissipation and\n monotonicity along a negative gradient trajectory.\n* `TauCeti.energy_maximalIntegralCurve_neg_mgradient`: over a bounded time interval the energy\n `\u00bd \u222b \u2016\u03b3'\u2016\u00b2` of a negative gradient trajectory is half the drop of `f`.\n* `TauCeti.integrableOn_Ioi_norm_mgradient_sq_maximalIntegralCurve` and\n `TauCeti.integral_Ioi_norm_mgradient_sq_maximalIntegralCurve`: the energy of a forward\n trajectory along which `f` has a limit is finite, and equals the drop of `f`.\n* `TauCeti.comp_maximalIntegralCurve_neg_mgradient_le_sub_mul`,\n `TauCeti.comp_maximalIntegralCurve_neg_mgradient_lt` and\n `TauCeti.exists_forall_comp_maximalIntegralCurve_neg_mgradient_lt`: a trajectory crosses a band\n on which the gradient is bounded away from zero in bounded time.\n* `TauCeti.mapsTo_maximalIntegralCurve_neg_mgradient_preimage_Iic`: a forward trajectory stays in\n the sublevel of its initial point.\n* `TauCeti.Ici_subset_maximalIntegralCurveInterval_neg_mgradient_of_tendsto`: a forward\n trajectory converging to a critical point exists for all positive time.\n* `TauCeti.le_comp_maximalIntegralCurve_neg_mgradient` and\n `TauCeti.tendsto_comp_maximalIntegralCurve_neg_mgradient`: along a forward trajectory, `f` stays\n above and tends to its value at any \u03c9-limit point.\n* `TauCeti.Ici_subset_maximalIntegralCurveInterval_neg_mgradient`: a trapped forward trajectory\n exists for all positive time.\n* `TauCeti.mem_criticalPoints_of_mapClusterPt_maximalIntegralCurve_neg_mgradient`: the \u03c9-limit\n points of a trapped forward trajectory are critical.\n* `TauCeti.exists_tendsto_maximalIntegralCurve_neg_mgradient`: a trapped forward trajectory\n converges to a critical point when only finitely many critical points lie in the trap.\n* `TauCeti.IsMorse.exists_tendsto_maximalIntegralCurve_neg_mgradient`: every forward negative\n gradient trajectory of a proper Morse function bounded below converges to a critical point.\n\n## References\n\n* M. W. Hirsch, S. Smale and R. L. Devaney, *Differential Equations, Dynamical Systems, and an\n Introduction to Chaos*, second edition, Academic Press, 2004, Chapter 9 (gradient systems).\n* M. Audin and M. Damian, *Morse Theory and Floer Homology*, Springer Universitext, 2014,\n Proposition 2.1.6.\n-/\n\npublic section\n\nopen Bundle Filter Function MeasureTheory Set Topology TauCeti.Manifold\nopen scoped ContDiff Manifold\n\nnamespace TauCeti\n\nvariable {E : Type*} [NormedAddCommGroup E] [NormedSpace \u211d E] [FiniteDimensional \u211d E]\n {H : Type*} [TopologicalSpace H] {I : ModelWithCorners \u211d E H}\n {M : Type*} [TopologicalSpace M] [ChartedSpace H M] [T2Space M] [IsManifold I 2 M]\n [BoundarylessManifold I M]\n [RiemannianBundle (fun x : M \u21a6 TangentSpace I x)]\n [IsContMDiffRiemannianBundle I 1 E (fun x : M \u21a6 TangentSpace I x)]\n {f : M \u2192 \u211d} {x : M} {K : Set M} {t : \u211d}\n\n/-- The maximal integral curve of `-grad f` is `C\u00b9` on its interval of definition. -/\ntheorem contMDiffOn_maximalIntegralCurve_neg_mgradient (hf : ContMDiff I \ud835\udcd8(\u211d) 2 f) :\n ContMDiffOn \ud835\udcd8(\u211d) I 1 (maximalIntegralCurve (-mgradient I f) x)\n (maximalIntegralCurveInterval (-mgradient I f) x) :=\n (contMDiffOn_two_of_isMIntegralCurveOn isOpen_maximalIntegralCurveInterval.uniqueDiffOn\n (isMIntegralCurveOn_maximalIntegralCurve (contMDiff_neg_mgradient_one hf))\n fun _ _ \u21a6 (contMDiff_neg_mgradient_one hf).contMDiffAt).of_le one_le_two\n\n/-- **Reversing time in a global negative gradient trajectory.** If the maximal integral curve of\n`-grad f` through `x` is defined for all time, then run backwards it is the maximal integral curve\nof `-grad (-f)` through `x`. -/\ntheorem maximalIntegralCurve_neg_mgradient_neg (hf : ContMDiff I \ud835\udcd8(\u211d) 2 f)\n (h\u03b3 : IsMIntegralCurve (maximalIntegralCurve (-mgradient I f) x) (-mgradient I f)) :\n maximalIntegralCurve (-mgradient I (-f)) x =\n maximalIntegralCurve (-mgradient I f) x \u2218 (\u00b7 * -1) := by\n have hrev : IsMIntegralCurve (maximalIntegralCurve (-mgradient I f) x \u2218 (\u00b7 * -1))\n (-mgradient I (-f)) := by\n convert h\u03b3.comp_mul (-1) using 1\n funext y\n simp [mgradient_neg]\n funext t\n simpa only [Function.comp_apply, zero_mul, maximalIntegralCurve_zero] using\n hrev.maximalIntegralCurve_eq (contMDiff_neg_mgradient_one (f := -f) hf.neg) t\n\n/-- **Reversing time in a forward negative gradient trajectory.** If the maximal integral curve of\n`-grad f` through `x` is defined for all positive time, then for `t \u2264 0` the maximal integral curve\nof `-grad (-f)` through `x` at time `t` is the trajectory of `-grad f` at time `-t`. Unlike\n`TauCeti.maximalIntegralCurve_neg_mgradient_neg`, the flow of `-grad f` need not be complete. -/\ntheorem maximalIntegralCurve_neg_mgradient_neg_of_nonpos (hf : ContMDiff I \ud835\udcd8(\u211d) 2 f)\n (hx : Ici 0 \u2286 maximalIntegralCurveInterval (-mgradient I f) x) (ht : t \u2264 0) :\n maximalIntegralCurve (-mgradient I (-f)) x t =\n maximalIntegralCurve (-mgradient I f) x (-t) := by\n -- The trajectory of `-grad f` is defined on a ray `(l, \u221e)` with `l < 0`.\n obtain \u27e8l, u, \u27e8hl, hu\u27e9, hlu\u27e9 := mem_nhds_iff_exists_Ioo_subset.1\n (isOpen_maximalIntegralCurveInterval.mem_nhds (hx (le_refl (0 : \u211d))))\n have hray : Ioi l \u2286 maximalIntegralCurveInterval (-mgradient I f) x := fun s hs \u21a6\n (lt_or_ge s u).elim (fun hsu \u21a6 hlu \u27e8hs, hsu\u27e9) fun hsu \u21a6 hx (hu.le.trans hsu)\n -- Reversing time turns it into an integral curve of `-grad (-f)` through `x` on `(-\u221e, -l)`.\n have hcurve : IsMIntegralCurveOn (maximalIntegralCurve (-mgradient I f) x \u2218 (\u00b7 * -1))\n (-mgradient I (-f)) (Iio (-l)) := by\n have h := ((isMIntegralCurveOn_maximalIntegralCurve\n (contMDiff_neg_mgradient_one hf)).mono hray).comp_mul (-1)\n have h2 : (-1 : \u211d) \u2022 -mgradient I f = -mgradient I (-f) := by\n funext y\n simp [mgradient_neg]\n rw [h2] at h\n exact h.mono fun s hs \u21a6 by rw [mem_ofPred_eq, mem_Ioi]; linarith [mem_Iio.1 hs]\n have h := (hcurve.mono (Ioo_subset_Iio_self (a := t - 1) (b := -l))).eqOn_maximalIntegralCurve\n (x := x) (contMDiff_neg_mgradient_one (f := -f) hf.neg) \u27e8by linarith, by linarith\u27e9\n (by simp [maximalIntegralCurve_zero])\n (show t \u2208 Ioo (t - 1) (-l) from \u27e8by linarith, by linarith\u27e9)\n simpa only [Function.comp_apply, mul_neg_one] using h\n\n/-! ### Energy dissipation -/\n\n/-- **Energy dissipation along a negative gradient trajectory.** Along the maximal integral curve\n`\u03b3` of `-grad f`, the function `f` has derivative `-\u2016grad f (\u03b3 t)\u2016\u00b2`. -/\ntheorem hasDerivAt_comp_maximalIntegralCurve_neg_mgradient (hf : ContMDiff I \ud835\udcd8(\u211d) 2 f)\n (ht : t \u2208 maximalIntegralCurveInterval (-mgradient I f) x) :\n HasDerivAt (fun s \u21a6 f (maximalIntegralCurve (-mgradient I f) x s))\n (-\u2016mgradient I f (maximalIntegralCurve (-mgradient I f) x t)\u2016 ^ 2) t := by\n have h\u03b3 := ((isMIntegralCurveOn_maximalIntegralCurve\n (contMDiff_neg_mgradient_one hf)).isMIntegralCurveAt\n (isOpen_maximalIntegralCurveInterval.mem_nhds ht)).hasMFDerivAt\n have h := hasDerivAt_comp_curve ((hf.mdifferentiable (by norm_num)) _) h\u03b3\n rwa [Pi.neg_apply, mvfderiv_apply_neg_mgradient] at h\n\n/-- **Energy monotonicity.** The function `f` is antitone along the maximal integral curve of its\nnegative gradient. -/\ntheorem antitoneOn_comp_maximalIntegralCurve_neg_mgradient (hf : ContMDiff I \ud835\udcd8(\u211d) 2 f) :\n AntitoneOn (fun s \u21a6 f (maximalIntegralCurve (-mgradient I f) x s))\n (maximalIntegralCurveInterval (-mgradient I f) x) := by\n have hderiv := fun s (hs : s \u2208 maximalIntegralCurveInterval (-mgradient I f) x) \u21a6\n hasDerivAt_comp_maximalIntegralCurve_neg_mgradient hf hs\n have hint : interior (maximalIntegralCurveInterval (-mgradient I f) x) =\n maximalIntegralCurveInterval (-mgradient I f) x :=\n isOpen_maximalIntegralCurveInterval.interior_eq\n refine antitoneOn_of_deriv_nonpos ordConnected_maximalIntegralCurveInterval.convex\n (fun s hs \u21a6 (hderiv s hs).continuousAt.continuousWithinAt) ?_ ?_ <;> rw [hint]\n \u00b7 exact fun s hs \u21a6 (hderiv s hs).differentiableAt.differentiableWithinAt\n \u00b7 intro s hs\n rw [(hderiv s hs).deriv, neg_nonpos]\n positivity\n\n/-- **A forward trajectory stays in the sublevel of its initial point.** The forward part of the\nmaximal integral curve of `-grad f` through `x` lies in the sublevel `{y | f y \u2264 f x}`. -/\ntheorem mapsTo_maximalIntegralCurve_neg_mgradient_preimage_Iic (hf : ContMDiff I \ud835\udcd8(\u211d) 2 f) :\n MapsTo (maximalIntegralCurve (-mgradient I f) x)\n (maximalIntegralCurveInterval (-mgradient I f) x \u2229 Ici 0) (f \u207b\u00b9' Iic (f x)) := by\n have : CompleteSpace E := FiniteDimensional.completeSpace \u211d E\n rintro s \u27e8hs, hs0\u27e9\n have h0 := zero_mem_maximalIntegralCurveInterval (x := x)\n (contMDiff_neg_mgradient_one hf).contMDiffAt\n have h : f (maximalIntegralCurve (-mgradient I f) x s) \u2264\n f (maximalIntegralCurve (-mgradient I f) x 0) :=\n antitoneOn_comp_maximalIntegralCurve_neg_mgradient hf h0 hs hs0\n rwa [maximalIntegralCurve_zero] at h\n\n/-- The function `-f` increases along a negative gradient trajectory at rate `\u2016grad f\u2016\u00b2`. -/\nprivate theorem hasDerivAt_neg_comp_maximalIntegralCurve_neg_mgradient\n (hf : ContMDiff I \ud835\udcd8(\u211d) 2 f) (ht : t \u2208 maximalIntegralCurveInterval (-mgradient I f) x) :\n HasDerivAt (fun s \u21a6 -f (maximalIntegralCurve (-mgradient I f) x s))\n (\u2016mgradient I f (maximalIntegralCurve (-mgradient I f) x t)\u2016 ^ 2) t := by\n have h := (hasDerivAt_comp_maximalIntegralCurve_neg_mgradient hf ht).neg\n rw [neg_neg] at h\n exact h\n\n/-- The velocity of the maximal integral curve of `-grad f` is `-grad f`. -/\ntheorem curveVelocity_maximalIntegralCurve_neg_mgradient (hf : ContMDiff I \ud835\udcd8(\u211d) 2 f)\n (ht : t \u2208 maximalIntegralCurveInterval (-mgradient I f) x) :\n curveVelocity I (maximalIntegralCurve (-mgradient I f) x) t =\n -mgradient I f (maximalIntegralCurve (-mgradient I f) x t) := by\n rw [\u2190 curveVelocityWithin_univ]\n exact curveVelocityWithin_eq_of_hasMFDerivWithinAt\n ((isMIntegralCurveOn_maximalIntegralCurve (contMDiff_neg_mgradient_one hf)).isMIntegralCurveAt\n (isOpen_maximalIntegralCurveInterval.mem_nhds ht)).hasMFDerivAt.hasMFDerivWithinAt\n uniqueDiffWithinAt_univ\n\n/-- **The energy identity on a bounded time interval.** Between two times `a` and `b` of its\ninterval of definition, the energy `\u00bd \u222b \u2016\u03b3'\u2016\u00b2` of the maximal integral curve `\u03b3` of `-grad f` is\nhalf the drop `f (\u03b3 a) - f (\u03b3 b)`. -/\ntheorem energy_maximalIntegralCurve_neg_mgradient (hf : ContMDiff I \ud835\udcd8(\u211d) 2 f) {a b : \u211d}\n (hab : uIcc a b \u2286 maximalIntegralCurveInterval (-mgradient I f) x) :\n energy I (maximalIntegralCurve (-mgradient I f) x) a b =\n (f (maximalIntegralCurve (-mgradient I f) x a) -\n f (maximalIntegralCurve (-mgradient I f) x b)) / 2 := by\n have : IsContinuousRiemannianBundle E (fun x : M \u21a6 TangentSpace I x) :=\n IsContMDiffRiemannianBundle.toIsContinuousRiemannianBundle (IB := I) (n := 1)\n set \u03b3 := maximalIntegralCurve (-mgradient I f) x\n -- the speed `\u2016\u03b3'\u2016 = \u2016grad f \u2218 \u03b3\u2016` is continuous, as the norm of a continuous section along `\u03b3`\n have hcont : ContinuousOn (fun s \u21a6 \u2016curveVelocity I \u03b3 s\u2016 ^ 2) (uIcc a b) := by\n refine (((continuous_norm_bundle E (fun x : M \u21a6 TangentSpace I x)).comp_continuousOn\n ((contMDiff_neg_mgradient_one hf).continuous.comp_continuousOn\n (isMIntegralCurveOn_maximalIntegralCurve\n (contMDiff_neg_mgradient_one hf)).continuousOn)).pow 2).congr ?_ |>.mono hab\n intro s hs\n simp [\u03b3, curveVelocity_maximalIntegralCurve_neg_mgradient hf hs]\n rw [energy_def, intervalIntegral.integral_eq_sub_of_hasDerivAt (f := fun s \u21a6 -f (\u03b3 s))\n (fun s hs \u21a6 ?_) hcont.intervalIntegrable]\n \u00b7 ring\n rw [curveVelocity_maximalIntegralCurve_neg_mgradient hf (hab hs), norm_neg]\n exact hasDerivAt_neg_comp_maximalIntegralCurve_neg_mgradient hf (hab hs)\n\n/-! ### Crossing a band -/\n\n", "statement": "/-- **Linear decrease where the gradient is long.** If `\u2016grad f\u2016\u00b2 \u2265 c` along the maximal integral\ncurve `\u03b3` of `-grad f` through `x` at all times of `[0, t]`, then `f (\u03b3 t) \u2264 f x - c t`. -/\ntheorem comp_maximalIntegralCurve_neg_mgradient_le_sub_mul (hf : ContMDiff I \ud835\udcd8(\u211d) 2 f) {c : \u211d}\n (ht : t \u2208 maximalIntegralCurveInterval (-mgradient I f) x) (ht0 : 0 \u2264 t)\n (hc : \u2200 s \u2208 Icc 0 t,\n c \u2264 \u2016mgradient I f (maximalIntegralCurve (-mgradient I f) x s)\u2016 ^ 2) :\n f (maximalIntegralCurve (-mgradient I f) x t) \u2264 f x - c * t ", "proof": " by\n set \u03b3 := maximalIntegralCurve (-mgradient I f) x\n have hsub : Icc 0 t \u2286 maximalIntegralCurveInterval (-mgradient I f) x :=\n ordConnected_maximalIntegralCurveInterval.out (zero_mem_maximalIntegralCurveInterval_of_mem ht)\n ht\n -- On `[0, t]` the derivative `-\u2016grad f (\u03b3 s)\u2016\u00b2` of `s \u21a6 f (\u03b3 s)` is at most `-c`.\n have hderiv : \u2200 s \u2208 Icc 0 t, HasDerivAt (fun s \u21a6 f (\u03b3 s)) (-\u2016mgradient I f (\u03b3 s)\u2016 ^ 2) s :=\n fun s hs \u21a6 hasDerivAt_comp_maximalIntegralCurve_neg_mgradient hf (hsub hs)\n have h := (convex_Icc 0 t).image_sub_le_mul_sub_of_deriv_le (C := -c)\n (fun s hs \u21a6 (hderiv s hs).continuousAt.continuousWithinAt)\n (fun s hs \u21a6 (hderiv s (interior_subset hs)).differentiableAt.differentiableWithinAt)\n (fun s hs \u21a6 by\n rw [(hderiv s (interior_subset hs)).deriv]\n linarith [hc s (interior_subset hs)])\n 0 \u27e8le_rfl, ht0\u27e9 t \u27e8ht0, le_rfl\u27e9 ht0\n simp only [\u03b3, maximalIntegralCurve_zero] at h\n linarith", "proof_lines": 16, "proof_length": 791, "rev": "75c8aed5fea63047615a25a9763fd5b68a86e891", "heartbeats": 1333, "image": "lean-compression:tauceti-75c8aed5fe-a608030cfc", "split": "dev"} {"path": "TauCeti/Analysis/CompletelyMonotone/Bernstein/LevyKhintchine/Uniqueness.lean", "module": "TauCeti.Analysis.CompletelyMonotone.Bernstein.LevyKhintchine.Uniqueness", "theorem": "TauCeti.eq_of_eqOn_bernsteinLevyKhintchineExponent", "prefix": "/-\nCopyright (c) 2026 The Tau Ceti contributors. All rights reserved.\nReleased under Apache 2.0 license as described in the file LICENSE.\nAuthors: The Tau Ceti contributors\n-/\nmodule\n\npublic import TauCeti.Analysis.CompletelyMonotone.Bernstein.LevyKhintchine.Representation\nimport TauCeti.Analysis.CompletelyMonotone.Bernstein.OpenHalfLine\n\n/-!\n# Uniqueness of the Levy--Khintchine representation\n\nThis file completes the Levy--Khintchine representation of Bernstein functions by proving that\nits killing coefficient, drift coefficient, and Levy measure are unique. The killing coefficient\nis the value of the exponent at zero, which agreement on the positive half-line already fixes\nbecause the exponent is continuous at that endpoint. For the other two parameters,\ndifferentiating on the positive half-line gives the Laplace transform of\n\n`b delta_0 + x mu(dx)`.\n\nUniqueness of open-half-line Laplace representations identifies these derivative measures. Their\nmass at zero recovers the drift `b`; after cancelling that atom, multiplication by `x` is\ninvertible away from zero, and the Levy condition `mu {0} = 0` recovers `mu`.\n\n## Main declarations\n\n* `TauCeti.eq_of_eqOn_bernsteinLevyKhintchineExponent`: two Levy--Khintchine triplets defining\n the same function on `(0, infinity)` are equal.\n* `TauCeti.IsBernsteinFunction.existsUnique_eqOn_bernsteinLevyKhintchineExponent`: every\n Bernstein function has a unique Levy--Khintchine triplet.\n\n## References\n\n* R. Schilling, R. Song, Z. Vondracek, *Bernstein Functions: Theory and Applications*\n (de Gruyter, 2nd ed. 2012), Theorem 3.2.\n-/\n\npublic section\n\nnoncomputable section\n\nopen MeasureTheory Set\nopen scoped ENNReal NNReal\n\nnamespace TauCeti\n\n/-- The measure whose Laplace transform is the derivative of a Levy--Khintchine exponent:\nthe drift is an atom at zero, and the jump measure is weighted by the coordinate. -/\nprivate noncomputable def bernsteinLevyKhintchineDerivativeMeasure\n (b : \u211d) (\u03bc : Measure \u211d\u22650) : Measure \u211d\u22650 :=\n (b.toNNReal : \u211d\u22650\u221e) \u2022 Measure.dirac 0 + bernsteinLevyDerivativeMeasure \u03bc\n\nprivate lemma representsLaplaceOnIoi_bernsteinLevyKhintchineDerivativeMeasure\n {\u03bc : Measure \u211d\u22650} (h\u03bc : Integrable (fun x : \u211d\u22650 => min 1 (x : \u211d)) \u03bc)\n {b : \u211d} (hb : 0 \u2264 b) :\n RepresentsLaplaceOnIoi (bernsteinLevyKhintchineDerivativeMeasure b \u03bc)\n (fun t => b + \u222b x : \u211d\u22650, (x : \u211d) * Real.exp (-(t * (x : \u211d))) \u2202\u03bc) :=\n ((((representsLaplace_dirac (0 : \u211d\u22650)).representsLaplaceOnIoi).smul b.toNNReal).add\n (representsLaplaceOnIoi_bernsteinLevyDerivativeMeasure h\u03bc)).congr fun _ _ => by\n simp [Real.coe_toNNReal b hb]\n\nprivate lemma bernsteinLevyKhintchineDerivativeMeasure_singleton_zero\n (b : \u211d) (\u03bc : Measure \u211d\u22650) :\n bernsteinLevyKhintchineDerivativeMeasure b \u03bc {0} = (b.toNNReal : \u211d\u22650\u221e) := by\n have hjump : bernsteinLevyDerivativeMeasure \u03bc {0} = 0 := by\n rw [bernsteinLevyDerivativeMeasure_apply \u03bc (measurableSet_singleton 0)]\n simp\n rw [bernsteinLevyKhintchineDerivativeMeasure, _root_.add_apply, hjump]\n simp\n\n/-- The Levy--Khintchine exponent of a measure with integrable truncated coordinate is\ncontinuous on the nonnegative half-line. -/\nprivate lemma continuousOn_bernsteinLevyKhintchineExponent {\u03bc : Measure \u211d\u22650}\n (h\u03bc : Integrable (fun x : \u211d\u22650 => min 1 (x : \u211d)) \u03bc) (a b : \u211d) :\n ContinuousOn (bernsteinLevyKhintchineExponent a b \u03bc) (Ici 0) := by\n rw [funext (bernsteinLevyKhintchineExponent_apply a b \u03bc)]\n exact (Continuous.continuousOn (by fun_prop)).add\n (continuousOn_bernsteinLevyJumpExponent h\u03bc)\n\n", "statement": "/-- **Uniqueness of Levy--Khintchine triplets.** If two triplets give the same function on the\npositive half-line, then their killing coefficients, drift coefficients, and Levy measures\nare respectively equal. -/\ntheorem eq_of_eqOn_bernsteinLevyKhintchineExponent\n {a b a' b' : \u211d} {\u03bc \u03bd : Measure \u211d\u22650}\n (h\u03bc : IsBernsteinLevyMeasure \u03bc) (h\u03bd : IsBernsteinLevyMeasure \u03bd)\n (hb : 0 \u2264 b) (hb' : 0 \u2264 b')\n (heq : Set.EqOn (bernsteinLevyKhintchineExponent a b \u03bc)\n (bernsteinLevyKhintchineExponent a' b' \u03bd) (Ioi 0)) :\n a = a' \u2227 b = b' \u2227 \u03bc = \u03bd ", "proof": " by\n have ha : a = a' := by\n have heqIci := heq.of_subset_closure\n (continuousOn_bernsteinLevyKhintchineExponent h\u03bc.integrable_min_one a b)\n (continuousOn_bernsteinLevyKhintchineExponent h\u03bd.integrable_min_one a' b')\n Ioi_subset_Ici_self (by rw [closure_Ioi])\n simpa only [bernsteinLevyKhintchineExponent_zero] using heqIci (mem_Ici.mpr le_rfl)\n have hderiv := heq.deriv isOpen_Ioi\n have hlaplace : Set.EqOn\n (fun t => b + \u222b x : \u211d\u22650, (x : \u211d) * Real.exp (-(t * (x : \u211d))) \u2202\u03bc)\n (fun t => b' + \u222b x : \u211d\u22650, (x : \u211d) * Real.exp (-(t * (x : \u211d))) \u2202\u03bd)\n (Ioi 0) := by\n intro t ht\n simpa only [deriv_bernsteinLevyKhintchineExponent h\u03bc.integrable_min_one a b ht,\n deriv_bernsteinLevyKhintchineExponent h\u03bd.integrable_min_one a' b' ht] using hderiv ht\n have hderivativeMeasure : bernsteinLevyKhintchineDerivativeMeasure b \u03bc =\n bernsteinLevyKhintchineDerivativeMeasure b' \u03bd :=\n (representsLaplaceOnIoi_bernsteinLevyKhintchineDerivativeMeasure\n h\u03bc.integrable_min_one hb).unique\n ((representsLaplaceOnIoi_bernsteinLevyKhintchineDerivativeMeasure\n h\u03bd.integrable_min_one hb').congr hlaplace)\n have hb_eq : b = b' := by\n have hmass := congrArg (fun \u03c1 : Measure \u211d\u22650 => \u03c1 {0}) hderivativeMeasure\n rw [bernsteinLevyKhintchineDerivativeMeasure_singleton_zero,\n bernsteinLevyKhintchineDerivativeMeasure_singleton_zero, ENNReal.coe_inj] at hmass\n simpa only [Real.coe_toNNReal b hb, Real.coe_toNNReal b' hb'] using\n congrArg (fun c : \u211d\u22650 => (c : \u211d)) hmass\n have hweighted : bernsteinLevyDerivativeMeasure \u03bc = bernsteinLevyDerivativeMeasure \u03bd := by\n simp only [bernsteinLevyKhintchineDerivativeMeasure, hb_eq] at hderivativeMeasure\n have : IsFiniteMeasure ((b'.toNNReal : \u211d\u22650\u221e) \u2022 Measure.dirac (0 : \u211d\u22650)) :=\n Measure.smul_finite _ (by simp)\n simpa using hderivativeMeasure\n have hmeasure : \u03bc = \u03bd := by\n calc\n \u03bc = (bernsteinLevyDerivativeMeasure \u03bc).withDensity\n (fun x => (x : \u211d\u22650\u221e)\u207b\u00b9) :=\n (withDensity_inv_bernsteinLevyDerivativeMeasure h\u03bc.measure_singleton_zero).symm\n _ = (bernsteinLevyDerivativeMeasure \u03bd).withDensity\n (fun x => (x : \u211d\u22650\u221e)\u207b\u00b9) := by rw [hweighted]\n _ = \u03bd := withDensity_inv_bernsteinLevyDerivativeMeasure h\u03bd.measure_singleton_zero\n exact \u27e8ha, hb_eq, hmeasure\u27e9", "proof_lines": 40, "proof_length": 2107, "rev": "75c8aed5fea63047615a25a9763fd5b68a86e891", "heartbeats": 981, "image": "lean-compression:tauceti-75c8aed5fe-a608030cfc", "split": "dev"} {"path": "TauCeti/Geometry/Manifold/ContMDiff/Curve.lean", "module": "TauCeti.Geometry.Manifold.ContMDiff.Curve", "theorem": "TauCeti.eventually_exists_contMDiff_curve", "prefix": "/-\nCopyright (c) 2026 The Tau Ceti contributors. All rights reserved.\nReleased under Apache 2.0 license as described in the file LICENSE.\nAuthors: The Tau Ceti contributors\n-/\nmodule\n\npublic import Mathlib.Analysis.SpecialFunctions.SmoothTransition\npublic import Mathlib.Geometry.Manifold.ContMDiff.Atlas\npublic import Mathlib.Geometry.Manifold.ContMDiff.NormedSpace\nimport TauCeti.Analysis.Calculus.ContDiff.IntervalExtension\nimport TauCeti.Geometry.Manifold.ExtChartAt\n\n/-!\n# Smooth curves joining points of a manifold\n\nA connected `C^n` manifold is `C^n`-path connected: any two of its points are joined by a `C^n`\ncurve `\u03b3 : \u211d \u2192 M` which is constant on `(-\u221e, 0]` and on `[1, \u221e)`\n(`TauCeti.exists_contMDiff_curve`). This holds over every model with corners, so manifolds with\nboundary or corners are included. Points close to `x` are joined to `x` by such curves staying in\nany prescribed neighbourhood of `x` (`TauCeti.eventually_exists_contMDiff_curve`): in the chart\nat `x`, follow the segment to the chart point of `y`, reparametrized by `Real.smoothTransition`.\nMathlib's `range I` is convex, so the segment stays in the model range.\n\nCurves which are constant near their endpoints can be concatenated smoothly\n(`TauCeti.curveConcat`, `ContMDiff.curveConcat`). The concatenation runs through `\u03b3\u2081` on\n`[0, 1/3]` and through `\u03b3\u2082` on `[2/3, 1]`, and rests at the junction point in between, so that it\nis locally a reparametrization of one of the two curves.\n\nIn a boundaryless `C^k` manifold (`k : \u2115`), a `C^k` curve on a closed real interval `[a, b]`\nextends across both endpoints to a curve that is two-sided `C^k` at every point of `[a, b]`\n(`ContMDiffOn.exists_contMDiffAt_Icc`).\n\nThese curves are the test curves of line integrals: a closed `1`-form whose integral along every\nsmooth loop vanishes is exact, with primitive the integral along smooth curves from a base point.\n\n## Main declarations\n\n* `TauCeti.curveConcat`: the concatenation of two curves `\u211d \u2192 X`.\n* `ContMDiff.curveConcat`: the concatenation of two `C^n` curves constant near the\n junction point is `C^n`.\n* `TauCeti.eventually_exists_contMDiff_curve`: nearby points are joined by short `C^n` curves.\n* `TauCeti.exists_contMDiff_curve`: a preconnected `C^n` manifold is `C^n`-path connected.\n* `ContMDiffOn.exists_contMDiffAt_Icc`: two-sided `C^k` extension of a closed-interval curve\n across its endpoints in a boundaryless manifold.\n-/\n\npublic section\n\nnoncomputable section\n\nopen Set Filter Metric\nopen scoped Manifold Topology\n\nnamespace TauCeti\n\n/-! ### Concatenation of curves -/\n\nsection Concat\n\nvariable {X : Type*}\n\n/-- The concatenation of two curves `\u03b3\u2081 \u03b3\u2082 : \u211d \u2192 X`: it is `\u03b3\u2081 (3 * t)` for `t \u2264 1/2` and\n`\u03b3\u2082 (3 * t - 2)` for `t > 1/2`. On `[0, 1]` it runs through `\u03b3\u2081` on `[0, 1]` and then through `\u03b3\u2082`\non `[0, 1]`. When `\u03b3\u2081` is constant on `[1, \u221e)` and `\u03b3\u2082` on `(-\u221e, 0]` with the same value, it rests\nat that point on `[1/3, 2/3]`, so near every parameter it agrees with a reparametrization of `\u03b3\u2081`\nor of `\u03b3\u2082` (`TauCeti.eqOn_curveConcat_left`, `TauCeti.eqOn_curveConcat_right`). -/\ndef curveConcat (\u03b3\u2081 \u03b3\u2082 : \u211d \u2192 X) (t : \u211d) : X :=\n if t \u2264 1 / 2 then \u03b3\u2081 (3 * t) else \u03b3\u2082 (3 * t - 2)\n\nvariable {\u03b3\u2081 \u03b3\u2082 : \u211d \u2192 X} {t : \u211d}\n\n@[simp]\ntheorem curveConcat_of_le (ht : t \u2264 2\u207b\u00b9) : curveConcat \u03b3\u2081 \u03b3\u2082 t = \u03b3\u2081 (3 * t) := by\n simp only [curveConcat, one_div, ht, \u2193reduceIte]\n\n@[simp]\ntheorem curveConcat_of_lt (ht : 2\u207b\u00b9 < t) : curveConcat \u03b3\u2081 \u03b3\u2082 t = \u03b3\u2082 (3 * t - 2) := by\n simp only [curveConcat, one_div, ht.not_ge, \u2193reduceIte]\n\nvariable {y : X}\n\n/-- If `\u03b3\u2081` rests at `y` from time `1` on and `\u03b3\u2082` rests at `y` up to time `0`, then the\nconcatenation agrees with `\u03b3\u2081` at triple speed before time `2/3`. -/\ntheorem eqOn_curveConcat_left (h\u2081 : \u2200 t, 1 \u2264 t \u2192 \u03b3\u2081 t = y) (h\u2082 : \u2200 t \u2264 0, \u03b3\u2082 t = y) :\n EqOn (curveConcat \u03b3\u2081 \u03b3\u2082) (fun t \u21a6 \u03b3\u2081 (3 * t)) (Iio (2 / 3)) := by\n intro t ht\n rcases le_or_gt t 2\u207b\u00b9 with h | h\n \u00b7 exact curveConcat_of_le h\n \u00b7 rw [curveConcat_of_lt h]\n exact (h\u2082 _ (by linarith [mem_Iio.mp ht])).trans (h\u2081 _ (by linarith)).symm\n\n/-- If `\u03b3\u2081` rests at `y` from time `1` on and `\u03b3\u2082` rests at `y` up to time `0`, then the\nconcatenation agrees with `\u03b3\u2082` at triple speed, shifted, after time `1/3`. -/\ntheorem eqOn_curveConcat_right (h\u2081 : \u2200 t, 1 \u2264 t \u2192 \u03b3\u2081 t = y) (h\u2082 : \u2200 t \u2264 0, \u03b3\u2082 t = y) :\n EqOn (curveConcat \u03b3\u2081 \u03b3\u2082) (fun t \u21a6 \u03b3\u2082 (3 * t - 2)) (Ioi (1 / 3)) := by\n intro t ht\n rcases le_or_gt t 2\u207b\u00b9 with h | h\n \u00b7 rw [curveConcat_of_le h]\n exact (h\u2081 _ (by linarith [mem_Ioi.mp ht])).trans (h\u2082 _ (by linarith)).symm\n \u00b7 exact curveConcat_of_lt h\n\n/-- If `\u03b3\u2081` rests at `y` from time `1` on and `\u03b3\u2082` rests at `y` up to time `0`, then the\nconcatenation rests at `y` between times `1/3` and `2/3`. -/\ntheorem curveConcat_eq_of_mem_Icc (h\u2081 : \u2200 t, 1 \u2264 t \u2192 \u03b3\u2081 t = y) (h\u2082 : \u2200 t \u2264 0, \u03b3\u2082 t = y)\n (ht : t \u2208 Icc (1 / 3) (2 / 3)) : curveConcat \u03b3\u2081 \u03b3\u2082 t = y := by\n rcases le_or_gt t 2\u207b\u00b9 with h | h\n \u00b7 rw [curveConcat_of_le h, h\u2081 _ (by linarith [ht.1])]\n \u00b7 rw [curveConcat_of_lt h, h\u2082 _ (by linarith [ht.2])]\n\nend Concat\n\nvariable {E H M : Type*} [NormedAddCommGroup E] [NormedSpace \u211d E] [TopologicalSpace H]\n {I : ModelWithCorners \u211d E H} [TopologicalSpace M] [ChartedSpace H M]\n\n/-- The concatenation of two `C^n` curves, the first resting at `y` from time `1` on and the\nsecond resting at `y` up to time `0`, is `C^n`. -/\ntheorem _root_.ContMDiff.curveConcat {n : WithTop \u2115\u221e} {\u03b3\u2081 \u03b3\u2082 : \u211d \u2192 M} {y : M}\n (h\u03b3\u2081 : ContMDiff \ud835\udcd8(\u211d, \u211d) I n \u03b3\u2081) (h\u03b3\u2082 : ContMDiff \ud835\udcd8(\u211d, \u211d) I n \u03b3\u2082)\n (h\u2081 : \u2200 t, 1 \u2264 t \u2192 \u03b3\u2081 t = y) (h\u2082 : \u2200 t \u2264 0, \u03b3\u2082 t = y) :\n ContMDiff \ud835\udcd8(\u211d, \u211d) I n (TauCeti.curveConcat \u03b3\u2081 \u03b3\u2082) := by\n have hs\u2081 : ContMDiff \ud835\udcd8(\u211d, \u211d) \ud835\udcd8(\u211d, \u211d) n fun s : \u211d \u21a6 3 * s :=\n (by fun_prop : ContDiff \u211d n fun s : \u211d \u21a6 3 * s).contMDiff\n have hs\u2082 : ContMDiff \ud835\udcd8(\u211d, \u211d) \ud835\udcd8(\u211d, \u211d) n fun s : \u211d \u21a6 3 * s - 2 :=\n (by fun_prop : ContDiff \u211d n fun s : \u211d \u21a6 3 * s - 2).contMDiff\n have heq : TauCeti.curveConcat \u03b3\u2081 \u03b3\u2082 =\n (Iic (1 / 2)).piecewise (fun t \u21a6 \u03b3\u2081 (3 * t)) fun t \u21a6 \u03b3\u2082 (3 * t - 2) := by\n ext t\n simp only [TauCeti.curveConcat, Set.piecewise, mem_Iic]\n rw [heq]\n refine (h\u03b3\u2081.comp hs\u2081).piecewise_Iic (h\u03b3\u2082.comp hs\u2082) ?_\n filter_upwards [Ioo_mem_nhds (by norm_num : (1 / 3 : \u211d) < 1 / 2)\n (by norm_num : (1 / 2 : \u211d) < 2 / 3)] with t ht\n exact (h\u2081 _ (by linarith [ht.1])).trans (h\u2082 _ (by linarith [ht.2])).symm\n\n/-! ### Smooth path connectivity -/\n\nvariable {n : \u2115\u221e}\n\n", "statement": "/-- Points close to `x` are joined to `x` by `C^n` curves staying in a prescribed neighbourhood\n`U` of `x`, which are constant on `(-\u221e, 0]` and on `[1, \u221e)`. -/\ntheorem eventually_exists_contMDiff_curve [IsManifold I n M] {x : M} {U : Set M} (hU : U \u2208 \ud835\udcdd x) :\n \u2200\u1da0 y in \ud835\udcdd x, \u2203 \u03b3 : \u211d \u2192 M, ContMDiff \ud835\udcd8(\u211d, \u211d) I n \u03b3 \u2227 (\u2200 t \u2264 0, \u03b3 t = x) \u2227\n (\u2200 t, 1 \u2264 t \u2192 \u03b3 t = y) \u2227 \u2200 t, \u03b3 t \u2208 U ", "proof": " by\n obtain \u27e8\u03b5, h\u03b5, hsub\u27e9 := exists_ball_inter_range_subset_extChartAt (I := I) hU\n obtain \u27e8hconv, -, hx\u27e9 := convex_uniqueDiffOn_ball_inter_range_extChartAt (I := I) x h\u03b5\n filter_upwards [extChartAt_source_mem_nhds (I := I) x,\n (continuousAt_extChartAt (I := I) x).preimage_mem_nhds (ball_mem_nhds _ h\u03b5)]\n with y hys hyb\n -- In the chart at `x`, follow the segment from the chart point of `x` to that of `y`.\n set c : \u211d \u2192 E := fun t \u21a6 extChartAt I x x +\n Real.smoothTransition t \u2022 (extChartAt I x y - extChartAt I x x) with hc_def\n have hmem (t : \u211d) : c t \u2208 ball (extChartAt I x x) \u03b5 \u2229 range I :=\n hconv.add_smul_sub_mem hx\n \u27e8hyb, extChartAt_target_subset_range x ((extChartAt I x).map_source hys)\u27e9\n \u27e8Real.smoothTransition.nonneg t, Real.smoothTransition.le_one t\u27e9\n have hc : ContMDiff \ud835\udcd8(\u211d, \u211d) \ud835\udcd8(\u211d, E) n c :=\n (contDiff_const.add (Real.smoothTransition.contDiff.smul contDiff_const)).contMDiff\n refine \u27e8(extChartAt I x).symm \u2218 c,\n (contMDiffOn_extChartAt_symm x).comp_contMDiff hc fun t \u21a6 (hsub (hmem t)).1,\n fun t ht \u21a6 ?_, fun t ht \u21a6 ?_, fun t \u21a6 (hsub (hmem t)).2\u27e9\n \u00b7 simp [hc_def, Real.smoothTransition.zero_of_nonpos ht]\n \u00b7 have hys' : y \u2208 (chartAt H x).source := by rwa [\u2190 extChartAt_source (I := I)]\n simp [hc_def, Real.smoothTransition.one_of_one_le ht, (chartAt H x).left_inv hys']", "proof_lines": 20, "proof_length": 1180, "rev": "75c8aed5fea63047615a25a9763fd5b68a86e891", "heartbeats": 2147, "image": "lean-compression:tauceti-75c8aed5fe-a608030cfc", "split": "dev"} {"path": "TauCeti/NumberTheory/FrobeniusRiesz/Top/Selection.lean", "module": "TauCeti.NumberTheory.FrobeniusRiesz.Top.Selection", "theorem": "TauCeti.eventually_half_le_measureReal_cyclicTopSelection", "prefix": "/-\nCopyright (c) 2026 The Tau Ceti contributors. All rights reserved.\nReleased under Apache 2.0 license as described in the file LICENSE.\nAuthors: The Tau Ceti contributors\n-/\nmodule\n\npublic import TauCeti.Probability.Concentration.WeightedCosetSelection\npublic import Mathlib.GroupTheory.Index\npublic import Mathlib.NumberTheory.PrimeCounting\nimport Mathlib.Analysis.SpecialFunctions.Pow.Asymptotics\nimport TauCeti.GroupTheory.Coset.Fiber\nimport TauCeti.NumberTheory.Chebyshev.Mertens.Basic\n\n/-!\n# Selecting tops for cyclic Frobenius averages\n\nSelect positions independently, at a rate four thirds as high in the identity coset as in\nother cosets. This profile gives nontrivial cyclic characters positive weight in the\nFrobenius average. At the dyadic host scales, the same selection gives the required\nprecision in the coset counts and a small logarithmically weighted count of bad positions.\n\nThe weighted bad-orbit count follows Levent Alp\u00f6ge's `Formalism.MainNotions.J.tops_exist_of`\nin [`GandSa.lean`][alpoege-rh], where the sampling profile is uniform.\n\n[alpoege-rh]: https://github.com/leanprover-community/riemann-hypothesis/blob/40e56bab026552e089d7afcfeff08d2defb9c005/src/Formalism/SharpRestriction/AdmissibleParameterJoins/GandSa.lean\n-/\n\npublic section\n\nopen Finset Filter MeasureTheory ProbabilityTheory Real Set\n\nnamespace Subgroup\n\nvariable {A : Type*} [Group A]\n\nopen Classical in\n/-- The independent selection measure on subsets of `A` (represented by Boolean functions),\nwith inclusion probability `\u03b4` on `H` and `3\u03b4/4` off `H`. -/\nnoncomputable def cyclicTopSelectionMeasure [Fintype A] (H : Subgroup A) (\u03b4 : unitInterval) :\n Measure (A \u2192 Bool) :=\n Measure.pi fun a \u21a6 bernoulliMeasure true false\n (\u03b4 * if a \u2208 H then 1 else \u27e83 / 4, by norm_num\u27e9)\n\nopen Classical in\n/-- The product formula for the cyclic top selection measure. -/\ntheorem cyclicTopSelectionMeasure_def [Fintype A] (H : Subgroup A) (\u03b4 : unitInterval) :\n H.cyclicTopSelectionMeasure \u03b4 = Measure.pi fun a \u21a6 bernoulliMeasure true false\n (\u03b4 * if a \u2208 H then 1 else \u27e83 / 4, by norm_num\u27e9) :=\n (rfl)\n\nopen Classical in\n/-- The marginal probability of selecting a position is its prescribed inclusion rate. -/\n@[simp]\ntheorem measureReal_cyclicTopSelectionMeasure_eval_eq_true [Fintype A]\n (H : Subgroup A) (\u03b4 : unitInterval) (a : A) :\n (H.cyclicTopSelectionMeasure \u03b4).real {s | s a = true} =\n (\u03b4 : \u211d) * (if a \u2208 H then 1 else 3 / 4) := by\n rw [cyclicTopSelectionMeasure_def,\n TauCeti.Probability.measureReal_pi_bernoulliMeasure_eval_eq_true, Set.Icc.coe_mul]\n split_ifs <;> simp\n\n/-- The cyclic top selection measure is a probability measure. -/\ninstance isProbabilityMeasure_cyclicTopSelectionMeasure [Fintype A]\n (H : Subgroup A) (\u03b4 : unitInterval) : IsProbabilityMeasure (H.cyclicTopSelectionMeasure \u03b4) := by\n rw [cyclicTopSelectionMeasure_def]\n infer_instance\n\nopen Classical in\n/-- The two inclusion-rate multipliers, before normalizing to coset shares. -/\nprivate noncomputable def cyclicTopProfile {Q : Type*} [One Q] (q : Q) : unitInterval :=\n if q = 1 then 1 else \u27e83 / 4, by norm_num\u27e9\n\nopen Classical in\n/-- Write the profile as its constant part plus its excess at the identity. -/\nprivate theorem coe_cyclicTopProfile {Q : Type*} [One Q] (q : Q) :\n (cyclicTopProfile q : \u211d) = 3 / 4 + if q = 1 then 1 / 4 else 0 := by\n by_cases h : q = 1 <;> norm_num [cyclicTopProfile, h]\n\n/-- In quotient coordinates the independent draws use the two-level profile. -/\nprivate theorem cyclicTopSelectionMeasure_eq_pi [Fintype A] (H : Subgroup A) [H.Normal]\n (\u03b4 : unitInterval) : H.cyclicTopSelectionMeasure \u03b4 = Measure.pi fun a \u21a6\n bernoulliMeasure true false (\u03b4 * cyclicTopProfile (QuotientGroup.mk' H a)) := by\n rw [cyclicTopSelectionMeasure_def]\n congr 1\n funext a\n have ha : QuotientGroup.mk' H a = 1 \u2194 a \u2208 H := QuotientGroup.eq_one_iff a\n by_cases h : a \u2208 H\n \u00b7 simp only [cyclicTopProfile, ite_eq_left h, ite_eq_left (ha.mpr h)]\n \u00b7 simp only [cyclicTopProfile, ite_eq_right h, ite_eq_right (ha.not.mpr h)]\n\nopen Classical in\n/-- The expected size for the two-level profile is between `3D/4` and `D`, where\n`D = \u03b4 * |A|`. Express its normalizing sum in terms of the index. -/\nprivate theorem cyclicTopProfile_sum_and_mean_bounds [Fintype A] (H : Subgroup A) [H.Normal]\n [Fintype (A \u29f8 H)] (\u03b4 : unitInterval) :\n let s := \u2211 q : A \u29f8 H, (cyclicTopProfile q : \u211d)\n let D := (\u03b4 : \u211d) * Fintype.card A\n s = (3 * (H.index : \u211d) + 1) / 4 \u2227\n 3 / 4 * D \u2264 (\u03b4 : \u211d) * Nat.card H * s \u2227 (\u03b4 : \u211d) * Nat.card H * s \u2264 D := by\n have hq : Fintype.card (A \u29f8 H) = H.index := Nat.card_eq_fintype_card.symm\n have hcard : (Fintype.card A : \u211d) = (H.index : \u211d) * Nat.card H := by\n exact_mod_cast (Nat.card_eq_fintype_card (\u03b1 := A)).symm.trans\n H.card_eq_card_quotient_mul_card_subgroup\n have hextra : (\u2211 q : A \u29f8 H, if q = 1 then (1 / 4 : \u211d) else 0) = 1 / 4 := by\n rw [sum_eq_single 1]\n \u00b7 simp\n \u00b7 intro q _ hq\n simp [hq]\n \u00b7 simp\n have hsum : (\u2211 q : A \u29f8 H, (cyclicTopProfile q : \u211d)) = (3 * (H.index : \u211d) + 1) / 4 := by\n simp only [coe_cyclicTopProfile, sum_add_distrib, sum_const, card_univ, nsmul_eq_mul, hq]\n calc\n _ = (H.index : \u211d) * (3 / 4) + 1 / 4 := by\n congr 1\n convert hextra using 2\n split_ifs <;> rfl\n _ = _ := by ring\n have ho : (1 : \u211d) \u2264 H.index := by\n rw [\u2190 hq, Nat.one_le_cast]\n exact Fintype.card_pos\n have h\u03b4m : 0 \u2264 (\u03b4 : \u211d) * Nat.card H := mul_nonneg \u03b4.prop.1 (Nat.cast_nonneg _)\n dsimp only\n refine \u27e8hsum, ?_, ?_\u27e9 <;> rw [hsum, hcard]\n \u00b7 nlinarith only [h\u03b4m]\n \u00b7 nlinarith only [mul_nonneg h\u03b4m (sub_nonneg.mpr ho)]\n\nopen Classical in\n/-- If the total sampling scale `\u03b4 * |A|` is at least `64 * [A : H]\u00b2`, with probability\nat least `1/2` the sample has size between `\u03b4 * |A| / 2` and `3 * \u03b4 * |A| / 2`. Its coset\ncounts approximate the shares in ratio `4 : 3`, and its weighted bad count is at most\n`8 * p * |S|` times the total weight. The probability of being selected and bad at an index\nmust be at most `p` times the selection probability. Bad events may depend on the entire sample. -/\ntheorem half_le_measureReal_cyclicTopSelection [Fintype A] (H : Subgroup A) [H.Normal]\n (\u03b4 : unitInterval) (hsize : 64 * (H.index : \u211d) ^ 2 \u2264 (\u03b4 : \u211d) * Fintype.card A)\n {\u03b9 : Type*} (I : Finset \u03b9) {w : \u03b9 \u2192 \u211d} (hw : \u2200 i \u2208 I, 0 \u2264 w i)\n (B : \u03b9 \u2192 A \u2192 Set (A \u2192 Bool)) (p : NNReal)\n (hbad : \u2200 i \u2208 I, \u2200 a, (H.cyclicTopSelectionMeasure \u03b4).real ({s | s a = true} \u2229 B i a) \u2264\n (p : \u211d) * (H.cyclicTopSelectionMeasure \u03b4).real {s | s a = true}) :\n (1 / 2 : \u211d) \u2264 (H.cyclicTopSelectionMeasure \u03b4).real {s |\n let S := univ.filter fun a \u21a6 s a = true\n let D := (\u03b4 : \u211d) * Fintype.card A\n D / 2 \u2264 (S.card : \u211d) \u2227 (S.card : \u211d) \u2264 3 * D / 2 \u2227\n (\u2200 q : A \u29f8 H, |((S.filter fun a \u21a6 QuotientGroup.mk' H a = q).card : \u211d) -\n ((if q = 1 then 4 else 3) / (3 * (H.index : \u211d) + 1)) * S.card| \u2264\n (112 / 9 / \u221aD) * S.card) \u2227\n S.weightedEventCount I w B s \u2264 8 * (p : \u211d) * S.card * \u2211 i \u2208 I, w i} := by\n let Q := A \u29f8 H\n let : Fintype Q := Fintype.ofFinite Q\n let f : A \u2192* Q := QuotientGroup.mk' H\n let \u03c9 : Q \u2192 unitInterval := cyclicTopProfile\n have hf (q : Q) : (univ.filter fun a \u21a6 f a = q).card = Nat.card H := by\n obtain \u27e8a, ha\u27e9 := QuotientGroup.mk'_surjective H q\n have h := (QuotientGroup.mk' H).card_fiber_eq_card_ker ha\n simpa only [QuotientGroup.ker_mk', Nat.card_eq_fintype_card, Fintype.card_subtype] using h\n have hq : Fintype.card Q = H.index := Nat.card_eq_fintype_card.symm\n have h\u03bc : H.cyclicTopSelectionMeasure \u03b4 = Measure.pi fun a \u21a6\n bernoulliMeasure true false (\u03b4 * \u03c9 (f a)) := cyclicTopSelectionMeasure_eq_pi H \u03b4\n obtain \u27e8hsum, hmeanlo, hmeanhi\u27e9 := cyclicTopProfile_sum_and_mean_bounds H \u03b4\n have hscale\u2081 : 16 * (Fintype.card Q : \u211d) ^ 2 / (3 / 4) ^ 2 \u2264 (\u03b4 : \u211d) * Fintype.card A := by\n rw [hq]\n norm_num\n linarith [sq_nonneg (H.index : \u211d)]\n have hscale\u2082 : 36 * (Fintype.card Q : \u211d) ^ 2 / (3 / 4) ^ 2 \u2264 (\u03b4 : \u211d) * Fintype.card A := by\n rw [hq]\n convert hsize using 1\n ring\n have hs := TauCeti.half_le_measureReal_bernoulli_card_fiber_and_weightedEventCount\n (Q := Q) f (m := Nat.card H) (fun q \u21a6 by\n convert hf q using 1\n congr 1\n apply filter_congr_decidable) \u03b4 \u03c9\n (by norm_num : (0 : \u211d) < 3 / 4)\n (fun q \u21a6 by rw [coe_cyclicTopProfile]; split_ifs <;> norm_num) hscale\u2081 I hw B p (fun i hi a \u21a6 by\n have hm := TauCeti.Probability.measureReal_pi_bernoulliMeasure_eval_eq_true\n (fun a' \u21a6 \u03b4 * \u03c9 (f a')) a\n rw [\u2190 Set.Icc.coe_mul, \u2190 hm, \u2190 h\u03bc]\n exact hbad i hi a)\n rw [\u2190 h\u03bc] at hs\n refine hs.trans (measureReal_mono fun s hs \u21a6 ?_)\n obtain \u27e8_, hup, hlo, hdisc, hbad\u2081, hbad\u2082\u27e9 := hs\n refine \u27e8by linarith only [hlo hscale\u2082, hmeanlo], by linarith only [hup, hmeanhi],\n fun q \u21a6 ?_, hbad\u2081.trans hbad\u2082\u27e9\n have h\u03bd : (\u03c9 q : \u211d) / \u2211 j, (\u03c9 j : \u211d) = (if q = 1 then 4 else 3) / (3 * (H.index : \u211d) + 1) := by\n rw [hsum, div_div_eq_mul_div, coe_cyclicTopProfile]\n congr 1\n split_ifs <;> norm_num\n have hd := hdisc q\n have hconst : (4 * (1 + 3 / 4) / (3 / 4) ^ 2 : \u211d) = 112 / 9 := by norm_num\n rw [h\u03bd, hconst] at hd\n convert hd using 5\n ext a\n simp only [Finset.mem_filter, Finset.mem_univ, true_and, f]\n\nend Subgroup\n\nnamespace TauCeti\n\nopen Classical in\n", "statement": "/-- At the dyadic host scales, the `4 : 3` selection simultaneously attains the top density,\ncoset precision and weighted bad-top bound. Here `I` is any set of primes up to the thin\ncutoff `exp (x ^ (\u03b5 / 3))`; the joint probability that a position is selected and bad at\n`p \u2208 I` is at most `C / x\u00b2` times its probability of selection. The threshold depends\nonly on `\u03b5`, the index `o` and this constant `C`, not on the group, the primes or the events. -/\ntheorem eventually_half_le_measureReal_cyclicTopSelection (o : \u2115) (C : NNReal) {\u03b5 : \u211d}\n (h\u03b5 : 0 < \u03b5) : \u2200\u1da0 x : \u211d in atTop, \u2203 \u03b4 : unitInterval, (\u03b4 : \u211d) = x ^ (-\u03b5 / 8) \u2227\n \u2200 {A : Type*} [Group A] [Fintype A] (H : Subgroup A) [H.Normal],\n H.index = o \u2192 x ^ (2 + 8 * \u03b5) \u2264 Fintype.card A \u2192\n \u2200 (I : Finset \u2115), I \u2286 Nat.primesLE \u230aexp (x ^ (\u03b5 / 3))\u230b\u208a \u2192\n \u2200 (B : \u2115 \u2192 A \u2192 Set (A \u2192 Bool)),\n (\u2200 p \u2208 I, \u2200 a, (H.cyclicTopSelectionMeasure \u03b4).real ({s | s a = true} \u2229 B p a) \u2264\n ((C : \u211d) / x ^ 2) * (H.cyclicTopSelectionMeasure \u03b4).real {s | s a = true}) \u2192\n (1 / 2 : \u211d) \u2264 (H.cyclicTopSelectionMeasure \u03b4).real {s |\n let S := univ.filter fun a \u21a6 s a = true\n x ^ (-\u03b5 / 8) * Fintype.card A / 2 \u2264 (S.card : \u211d) \u2227\n (S.card : \u211d) \u2264 3 * (x ^ (-\u03b5 / 8) * Fintype.card A) / 2 \u2227\n (\u2200 q : A \u29f8 H, |((S.filter fun a \u21a6 QuotientGroup.mk' H a = q).card : \u211d) -\n ((if q = 1 then 4 else 3) / (3 * (o : \u211d) + 1)) * S.card| \u2264\n x ^ (-1 + \u03b5) * S.card) \u2227\n S.weightedEventCount I (fun p \u21a6 log p / p) B s \u2264 S.card * x ^ (-2 + \u03b5)} ", "proof": " by\n have h\u2081 := (tendsto_rpow_atTop (by linarith : 0 < 2 + 63 * \u03b5 / 8)).eventually_ge_atTop\n (64 * (o : \u211d) ^ 2)\n have h\u2082 := (tendsto_rpow_atTop (by linarith : 0 < 79 * \u03b5 / 16)).eventually_ge_atTop (112 / 9)\n have h\u2083 := (tendsto_rpow_atTop (by linarith : 0 < 2 * \u03b5 / 3)).eventually_ge_atTop\n (8 * (C : \u211d) * (1 + (log 4 + 4)))\n filter_upwards [eventually_ge_atTop (1 : \u211d), h\u2081, h\u2082, h\u2083] with x hx hsize hprec hcost\n have hx\u2080 : 0 < x := zero_lt_one.trans_le hx\n let \u03b4 : unitInterval := \u27e8x ^ (-\u03b5 / 8), rpow_nonneg hx\u2080.le _,\n rpow_le_one_of_one_le_of_nonpos hx (by linarith)\u27e9\n refine \u27e8\u03b4, rfl, ?_\u27e9\n intro A _ _ H _ ho hA I hI B hbad\n have hD : x ^ (2 + 63 * \u03b5 / 8) \u2264 (\u03b4 : \u211d) * Fintype.card A := calc\n _ = x ^ (-\u03b5 / 8) * x ^ (2 + 8 * \u03b5) := by rw [\u2190 rpow_add hx\u2080]; congr 1; ring\n _ \u2264 _ := mul_le_mul_of_nonneg_left hA \u03b4.prop.1\n have h\u03b7 : 112 / 9 / \u221a((\u03b4 : \u211d) * Fintype.card A) \u2264 x ^ (-1 + \u03b5) := by\n apply (div_le_iff\u2080 (sqrt_pos_of_pos ((rpow_pos_of_pos hx\u2080 _).trans_le hD))).2\n calc\n 112 / 9 \u2264 x ^ (79 * \u03b5 / 16) := hprec\n _ = x ^ (-1 + \u03b5) * \u221a(x ^ (2 + 63 * \u03b5 / 8)) := by\n rw [sqrt_eq_rpow, \u2190 rpow_mul hx\u2080.le, \u2190 rpow_add hx\u2080]\n congr 1\n ring\n _ \u2264 _ := by gcongr\n -- The logarithmic weight of the thin primes costs only a power `x ^ (\u03b5 / 3)`.\n have hbudget : 8 * ((C : \u211d) / x ^ 2) * (\u2211 p \u2208 I, log p / p) \u2264 x ^ (-2 + \u03b5) := by\n have hy : 1 \u2264 exp (x ^ (\u03b5 / 3)) := one_le_exp (rpow_nonneg hx\u2080.le _)\n have hsum := (sum_le_sum_of_subset_of_nonneg hI (fun p _ _ \u21a6 by positivity)).trans\n (Chebyshev.sum_primesLE_log_div_le hy)\n rw [log_exp] at hsum\n have hu := one_le_rpow hx (by linarith : 0 \u2264 \u03b5 / 3)\n have hc : 0 \u2264 log 4 + 4 := by positivity\n have ht : \u2211 p \u2208 I, log p / p \u2264 (1 + (log 4 + 4)) * x ^ (\u03b5 / 3) := by\n linarith only [hsum, mul_le_mul_of_nonneg_left hu hc]\n calc\n _ \u2264 8 * ((C : \u211d) / x ^ 2) * ((1 + (log 4 + 4)) * x ^ (\u03b5 / 3)) := by gcongr\n _ = (8 * (C : \u211d) * (1 + (log 4 + 4))) * x ^ (\u03b5 / 3) / x ^ 2 := by ring\n _ \u2264 x ^ (2 * \u03b5 / 3) * x ^ (\u03b5 / 3) / x ^ 2 := by gcongr\n _ = _ := by rw [\u2190 rpow_add hx\u2080, \u2190 rpow_natCast, \u2190 rpow_sub hx\u2080]; congr 1; push_cast; ring\n let pbad : NNReal := \u27e8(C : \u211d) / x ^ 2, by positivity\u27e9\n have hs := H.half_le_measureReal_cyclicTopSelection \u03b4 (ho \u25b8 hsize.trans hD) I\n (w := fun p \u21a6 log p / p) (fun p _ \u21a6 by positivity) B pbad hbad\n refine hs.trans (measureReal_mono fun s hs \u21a6 ?_)\n obtain \u27e8hlo, hup, hdisc, hcount\u27e9 := hs\n refine \u27e8hlo, hup, fun q \u21a6 ?_, hcount.trans ?_\u27e9\n \u00b7 rw [\u2190 ho]\n exact (hdisc q).trans (mul_le_mul_of_nonneg_right h\u03b7 (by positivity))\n \u00b7 have hpbad : (pbad : \u211d) = (C : \u211d) / x ^ 2 := rfl\n simpa only [hpbad, mul_comm, mul_left_comm, mul_assoc] using\n mul_le_mul_of_nonneg_left hbudget\n (Nat.cast_nonneg (\u03b1 := \u211d) (univ.filter fun a \u21a6 s a = true).card)", "proof_lines": 50, "proof_length": 2552, "rev": "75c8aed5fea63047615a25a9763fd5b68a86e891", "heartbeats": 11605, "image": "lean-compression:tauceti-75c8aed5fe-a608030cfc", "split": "dev"} {"path": "TauCeti/Analysis/Pseudodifferential/Manifold/VectorBundle/ContinuousQuantization.lean", "module": "TauCeti.Analysis.Pseudodifferential.Manifold.VectorBundle.ContinuousQuantization", "theorem": "TauCeti.exists_linearMap_sectionClassicalPrincipalSymbol_eq_and_continuous", "prefix": "/-\nCopyright (c) 2026 The Tau Ceti contributors. All rights reserved.\nReleased under Apache 2.0 license as described in the file LICENSE.\nAuthors: The Tau Ceti contributors\n-/\nmodule\n\npublic import TauCeti.Analysis.Pseudodifferential.Manifold.ContinuousQuantization\npublic import TauCeti.Analysis.Pseudodifferential.Manifold.VectorBundle.Sobolev\npublic import TauCeti.Analysis.Pseudodifferential.Manifold.VectorBundle.SymbolQuantization\nimport TauCeti.Geometry.Manifold.PartitionOfUnity.Compact\n\n/-!\n# Continuous quantization of principal symbols between vector bundles\n\nLet `M` be a compact manifold modelled on `\u211d\u207f` and `E`, `F` smooth complex vector bundles over `M`\nwith finite-dimensional model fibres `V` and `W`. Every classical pseudodifferential operator\n`P : \u0393(E) \u2192 \u0393(F)` of order `m` extends to a bounded operator `H^s(M; E) \u2192 H^q(M; F)`, `q \u2264 s - m`\n(`TauCeti.sectionChartSobolevExtension`), and its principal symbol is a smooth positively\nhomogeneous `Hom(E, F)`-valued symbol of degree `m` (`TauCeti.sectionHomogeneousCotangentSymbols`).\nThis file shows that there is a linear map `Q` from these symbols to the classical\npseudodifferential operators of order `m` with `\u03c3_m(Q(a)) = a`, continuous for the `C^\u221e` topology of\nthe symbols on compact sets of positions times the unit sphere of frequencies, read in charts and\nframes, and the operator norm of `H^s(M; E) \u2192 H^q(M; F)`. As a consequence, a continuous family\n`a_y` of principal symbols, for instance a homotopy of elliptic symbols, lifts to a family of\nclassical pseudodifferential operators `P_y` with `\u03c3_m(P_y) = a_y`, continuous in the operator norm,\nwhich starts at any prescribed operator `P\u2080` with principal symbol `a_{y\u2080}`: take\n`P_y = Q(a_y) + P\u2080 - Q(a_{y\u2080})`. This is the bundle form of\n`TauCeti.exists_classicalPrincipalSymbol_eq_and_continuous_chartSobolevExtension`.\n\n## The construction\n\nTake a finite partition of unity `\u03c1\u1d62` on `M` subordinate to the common base sets of\ntrivializations `t\u1d62` of `E` and `t'\u1d62` of `F`, cutoffs `\u03b8\u1d62` equal to `1` near the supports of the\n`\u03c1\u1d62` and supported in these base sets, bases `(b\u2096)` of `V` and `(c\u2c7c)` of `W`, and the continuous\nlinear quantization `Q\u2080` of scalar principal symbols\n(`TauCeti.exists_linearMap_classicalPrincipalSymbol_eq_and_continuous`). Then\n\n`Q(a) s = \u2211\u1d62 \u2211\u2c7c \u2211\u2096 Q\u2080(a\u1d62\u2c7c\u2096) (\u03b8\u1d62 b\u2096*(t\u1d62 s)) \u03b8\u1d62 t'\u1d62\u207b\u00b9 c\u2c7c`,\n\nwhere `a\u1d62\u2c7c\u2096(x, \u03be) = \u03c1\u1d62(x) \u03b8\u1d62(x) c\u2c7c*(t'\u1d62 (a(x, \u03be) (t\u1d62\u207b\u00b9 b\u2096)))` are the scalar readings of `a`. It has\nprincipal symbol `\u2211\u1d62 \u03c1\u1d62 a = a`\n(`TauCeti.sectionClassicalPrincipalSymbol_sum_sum_toSpanSingleton_comp_comp_cutoffFrameCoeff`).\n\n## Continuity\n\nEach term is a scalar operator `A` tensored with cut-off frames, `s \u21a6 A (\u03c1 \u2113(t s)) \u03c3`. Its\nextension to `H^s(M; E) \u2192 H^q(M; F)` factors as\n\n`H^s(M; E) \u2192 H^s(M) \u2192 H^q(M) \u2192 H^q(M; F)`\n\nthrough the extension of `A` to the scalar Sobolev spaces\n(`TauCeti.sectionChartSobolevExtension_toSpanSingleton_comp_comp_cutoffFrameCoeff`): taking a\nframe coefficient `s \u21a6 \u03c1 \u2113(t s)` is bounded `H^s(M; E) \u2192 H^s(M)`\n(`TauCeti.exists_norm_chartReading_cutoffFrameCoeff_le`), and so is multiplying a function by the\nsmooth section `\u03c3`, from `H^q(M)` to `H^q(M; F)`\n(`TauCeti.exists_norm_sectionChartReading_smul_le`): its readings are those of the function\nmultiplied by the smooth frame coefficients of `\u03c3`, an operator of order `0`. Since composition\nwith fixed bounded operators is continuous, the continuity of `Q\u2080` in the operator norm of the\nscalar Sobolev spaces passes to `Q`.\n\n## Main results\n\n* `TauCeti.exists_linearMap_sectionClassicalPrincipalSymbol_eq_and_continuous`: on a compact\n manifold there is a linear map `Q` from principal symbols to classical pseudodifferential\n operators between the bundles with `\u03c3_m(Q(a)) = a`, continuous in the above sense.\n* `TauCeti.exists_sectionClassicalPrincipalSymbol_eq_and_continuous_sectionChartSobolevExtension`:\n continuous families of principal symbols lift to continuous families of operators with a\n prescribed initial value.\n\n## References\n\n* R. Melrose, *Introduction to Microlocal Analysis*, \u00a75.3, Proposition 5.2 and its proof,\n (5.35)\u2013(5.36) (the quantization of principal symbols by patching and its continuity).\n* M. F. Atiyah and I. M. Singer, *The index of elliptic operators: I*, Ann. of Math. 87 (1968),\n \u00a75 (continuous families of symbols and operators).\n-/\n\npublic section\n\nnoncomputable section\n\nopen Bundle Module Set TauCeti\nopen scoped ContDiff Manifold Distributions SchwartzMap BesselPotentialSpace\n\nnamespace TauCeti\n\nopen OpenPartialHomeomorph\n\nvariable {n : \u2115} {M : Type*} [TopologicalSpace M] [ChartedSpace (CoordinateSpace n) M]\n [T2Space M] [IsManifold \ud835\udcd8(\u211d, CoordinateSpace n) \u221e M]\n {V : Type*} [NormedAddCommGroup V] [NormedSpace \u2102 V] [FiniteDimensional \u2102 V]\n {E : M \u2192 Type*} [TopologicalSpace (TotalSpace V E)] [\u2200 x, AddCommGroup (E x)]\n [\u2200 x, Module \u211d (E x)] [\u2200 x, Module \u2102 (E x)] [\u2200 x, TopologicalSpace (E x)] [FiberBundle V E]\n [VectorBundle \u211d V E] [VectorBundle \u2102 V E] [ContMDiffVectorBundle \u221e V E \ud835\udcd8(\u211d, CoordinateSpace n)]\n {W : Type*} [NormedAddCommGroup W] [NormedSpace \u2102 W] [FiniteDimensional \u2102 W]\n {F : M \u2192 Type*} [TopologicalSpace (TotalSpace W F)] [\u2200 x, AddCommGroup (F x)]\n [\u2200 x, Module \u211d (F x)] [\u2200 x, Module \u2102 (F x)] [\u2200 x, TopologicalSpace (F x)] [FiberBundle W F]\n [VectorBundle \u211d W F] [VectorBundle \u2102 W F] [ContMDiffVectorBundle \u221e W F \ud835\udcd8(\u211d, CoordinateSpace n)]\n {m : \u211d} {\u03b9 \u03ba \u03bd \u03bc : Type*} [Fintype \u03b9] [Fintype \u03ba] [Fintype \u03bd] [Fintype \u03bc]\n {e : \u03ba \u2192 OpenPartialHomeomorph M (CoordinateSpace n)}\n {he : \u2200 i, e i \u2208 IsManifold.maximalAtlas \ud835\udcd8(\u211d, CoordinateSpace n) \u221e M}\n {\u03c8 : \u2200 i, \ud835\udcd3(\u27e8(e i).target, (e i).open_target\u27e9, \u211d)} {t : \u03ba \u2192 Trivialization V (\u03c0 V E)}\n [\u2200 i, MemTrivializationAtlas (t i)] {\u03c1 : \u03ba \u2192 C^\u221e\u27ee\ud835\udcd8(\u211d, CoordinateSpace n), M; \u211d\u27ef}\n {h\u03c1 : \u2200 i, tsupport (\u03c1 i) \u2286 (t i).baseSet} {b : Module.Basis \u03b9 \u2102 V}\n {e' : \u03bd \u2192 OpenPartialHomeomorph M (CoordinateSpace n)}\n {he' : \u2200 j, e' j \u2208 IsManifold.maximalAtlas \ud835\udcd8(\u211d, CoordinateSpace n) \u221e M}\n {\u03c6 : \u2200 j, \ud835\udcd3(\u27e8(e' j).target, (e' j).open_target\u27e9, \u211d)} {t' : \u03bd \u2192 Trivialization W (\u03c0 W F)}\n [\u2200 j, MemTrivializationAtlas (t' j)] {\u03c7 : \u03bd \u2192 C^\u221e\u27ee\ud835\udcd8(\u211d, CoordinateSpace n), M; \u211d\u27ef}\n {h\u03c7 : \u2200 j, tsupport (\u03c7 j) \u2286 (t' j).baseSet} {b' : Module.Basis \u03bc \u2102 W}\n {\u03b1 : Type*} [Fintype \u03b1] {c : \u03b1 \u2192 OpenPartialHomeomorph M (CoordinateSpace n)}\n {hc : \u2200 i, c i \u2208 IsManifold.maximalAtlas \ud835\udcd8(\u211d, CoordinateSpace n) \u221e M}\n {\u03c6\u2080 : \u2200 i, \ud835\udcd3(\u27e8(c i).target, (c i).open_target\u27e9, \u211d)} {s q : \u211d}\n\nvariable (h\u03c8 : \u2200 x, \u2211 i, (e i).cutoffPullback (he i) (\u03c8 i) 1 x = 1)\n (h\u03c1\u03c8 : \u2200 i, \u2200 y \u2208 tsupport (\u03c8 i), \u03c1 i ((e i).symm y) = 1)\n (h\u03c6\u2080 : \u2200 x, \u2211 i, (c i).cutoffPullback (hc i) (\u03c6\u2080 i) 1 x = 1)\n\n/-! ### The quantization of principal symbols between bundles -/\n\nvariable (n V E W F m) in\n/-- The reading `\u03c7(x) \u03c8(x) \u2113(t'\u2093 (a(x, \u03be) (t\u207b\u00b9\u2093 v)))` of a smooth homogeneous `Hom(E, F)`-valued\nsymbol `a`, as a linear map to the smooth homogeneous scalar symbols. -/\nprivate def sectionSymbolReading (t\u2080 : Trivialization V (\u03c0 V E)) [MemTrivializationAtlas t\u2080]\n (\u03c8\u2080 : C^\u221e\u27ee\ud835\udcd8(\u211d, CoordinateSpace n), M; \u211d\u27ef) (h\u03c8\u2080 : tsupport \u03c8\u2080 \u2286 t\u2080.baseSet) (v : V)\n (t\u2080' : Trivialization W (\u03c0 W F)) [MemTrivializationAtlas t\u2080']\n (\u03c7\u2080 : C^\u221e\u27ee\ud835\udcd8(\u211d, CoordinateSpace n), M; \u211d\u27ef) (h\u03c7\u2080 : tsupport \u03c7\u2080 \u2286 t\u2080'.baseSet)\n (\u2113 : W \u2192L[\u2102] \u2102) :\n sectionHomogeneousCotangentSymbols n V E W F m \u2192\u2097[\u2102] homogeneousCotangentSymbols n M m where\n toFun a := \u27e8_, mem_sectionHomogeneousCotangentSymbols_iff.1 a.property t\u2080 \u03c8\u2080 h\u03c8\u2080 v t\u2080' \u03c7\u2080 h\u03c7\u2080 \u2113\u27e9\n map_add' a a' := Subtype.ext <| funext\u2082 fun x \u03be \u21a6 by simp [mul_add]\n map_smul' z a := Subtype.ext <| funext\u2082 fun x \u03be \u21a6 by simp [mul_left_comm]\n\nomit [T2Space M] [IsManifold \ud835\udcd8(\u211d, CoordinateSpace n) \u221e M] [NormedSpace \u2102 V]\n [FiniteDimensional \u2102 V] [\u2200 x, Module \u211d (E x)] [VectorBundle \u211d V E] [VectorBundle \u2102 V E]\n [ContMDiffVectorBundle \u221e V E \ud835\udcd8(\u211d, CoordinateSpace n)] [FiniteDimensional \u2102 W]\n [\u2200 x, Module \u211d (F x)] [VectorBundle \u211d W F]\n [ContMDiffVectorBundle \u221e W F \ud835\udcd8(\u211d, CoordinateSpace n)] in\n/-- The reading of `a` is the function `(x, \u03be) \u21a6 \u03c7(x) \u03c8(x) \u2113(t'\u2093 (a(x, \u03be) (t\u207b\u00b9\u2093 v)))`. -/\nprivate theorem coe_sectionSymbolReading_apply (t\u2080 : Trivialization V (\u03c0 V E))\n [MemTrivializationAtlas t\u2080] (\u03c8\u2080 : C^\u221e\u27ee\ud835\udcd8(\u211d, CoordinateSpace n), M; \u211d\u27ef)\n (h\u03c8\u2080 : tsupport \u03c8\u2080 \u2286 t\u2080.baseSet) (v : V) (t\u2080' : Trivialization W (\u03c0 W F))\n [MemTrivializationAtlas t\u2080'] (\u03c7\u2080 : C^\u221e\u27ee\ud835\udcd8(\u211d, CoordinateSpace n), M; \u211d\u27ef)\n (h\u03c7\u2080 : tsupport \u03c7\u2080 \u2286 t\u2080'.baseSet) (\u2113 : W \u2192L[\u2102] \u2102)\n (a : sectionHomogeneousCotangentSymbols n V E W F m) :\n (sectionSymbolReading n V E W F m t\u2080 \u03c8\u2080 h\u03c8\u2080 v t\u2080' \u03c7\u2080 h\u03c7\u2080 \u2113 a :\n (x : M) \u2192 (TangentSpace \ud835\udcd8(\u211d, CoordinateSpace n) x \u2192L[\u211d] \u211d) \u2192 \u2102) =\n fun x \u03be \u21a6 ((\u03c7\u2080 x * \u03c8\u2080 x : \u211d) : \u2102) *\n \u2113 (t\u2080'.continuousLinearMapAt \u2102 x (a.val x \u03be (t\u2080.symm x v))) :=\n rfl\n\nsection Quantization\n\nvariable {Q\u2080 : homogeneousCotangentSymbols n M m \u2192\u2097[\u2102]\n (C^\u221e\u27ee\ud835\udcd8(\u211d, CoordinateSpace n), M; \ud835\udcd8(\u211d, \u2102), \u2102\u27ef \u2192\u2097[\u2102]\n C^\u221e\u27ee\ud835\udcd8(\u211d, CoordinateSpace n), M; \ud835\udcd8(\u211d, \u2102), \u2102\u27ef)}\n {\u03b3 : Type*} [Fintype \u03b3] {T : \u03b3 \u2192 Trivialization V (\u03c0 V E)} [\u2200 i, MemTrivializationAtlas (T i)]\n {T' : \u03b3 \u2192 Trivialization W (\u03c0 W F)} [\u2200 i, MemTrivializationAtlas (T' i)]\n {\u03f1 \u03b8 : \u03b3 \u2192 C^\u221e\u27ee\ud835\udcd8(\u211d, CoordinateSpace n), M; \u211d\u27ef}\n {h\u03b8E : \u2200 i, tsupport (\u03b8 i) \u2286 (T i).baseSet} {h\u03b8F : \u2200 i, tsupport (\u03b8 i) \u2286 (T' i).baseSet}\n {h\u03f1F : \u2200 i, tsupport (\u03f1 i) \u2286 (T' i).baseSet}\n\nvariable (Q\u2080 T T' \u03f1 \u03b8 h\u03b8E h\u03b8F h\u03f1F) in\n/-- The term `u \u21a6 Q\u2080(a\u1d62\u2c7c\u2096) (\u03b8\u1d62 b\u2096*(T\u1d62 u)) \u03b8\u1d62 T'\u1d62\u207b\u00b9 c\u2c7c` of the quantization of a smooth homogeneous\n`Hom(E, F)`-valued symbol `a`, built from the quantization `Q\u2080` of its scalar reading\n`a\u1d62\u2c7c\u2096(x, \u03be) = \u03f1\u1d62(x) \u03b8\u1d62(x) c\u2c7c*(T'\u1d62 (a(x, \u03be) (T\u1d62\u207b\u00b9 b\u2096)))`, for bases `(b\u2096)` of `V` and `(c\u2c7c)` of\n`W`. -/\nprivate def sectionQuantizationTerm (i : \u03b3) (j : Fin (finrank \u2102 W)) (k : Fin (finrank \u2102 V))\n (a : sectionHomogeneousCotangentSymbols n V E W F m) :\n C\u209b^\u221e\u27ee\ud835\udcd8(\u211d, CoordinateSpace n); V, E\u27ef \u2192\u2097[\u2102] C\u209b^\u221e\u27ee\ud835\udcd8(\u211d, CoordinateSpace n); W, F\u27ef :=\n (LinearMap.toSpanSingleton _ _\n ((T' i).cutoffFrameSection (\u03b8 i) (h\u03b8F i) (finBasis \u2102 W j))).restrictScalars \u2102 \u2218\u2097\n Q\u2080 (sectionSymbolReading n V E W F m (T i) (\u03b8 i) (h\u03b8E i) (finBasis \u2102 V k) (T' i) (\u03f1 i)\n (h\u03f1F i) ((finBasis \u2102 W).coord j).toContinuousLinearMap a) \u2218\u2097\n (T i).cutoffFrameCoeff (\u03b8 i) (h\u03b8E i) ((finBasis \u2102 V).coord k).toContinuousLinearMap\n\nomit [IsManifold \ud835\udcd8(\u211d, CoordinateSpace n) \u221e M] [Fintype \u03b3] in\n/-- Each term of the quantization is a classical pseudodifferential operator of order `m`. -/\nprivate theorem sectionQuantizationTerm_mem\n (hQ\u2080 : \u2200 a, Q\u2080 a \u2208 classicalPseudodifferentialOperators m) (i : \u03b3) (j : Fin (finrank \u2102 W))\n (k : Fin (finrank \u2102 V)) (a : sectionHomogeneousCotangentSymbols n V E W F m) :\n sectionQuantizationTerm Q\u2080 T T' \u03f1 \u03b8 h\u03b8E h\u03b8F h\u03f1F i j k a \u2208\n sectionClassicalPseudodifferentialOperators m :=\n toSpanSingleton_comp_comp_cutoffFrameCoeff_mem_sectionClassicalPseudodifferentialOperators\n (hQ\u2080 _) _ _ _ _ _\n\nvariable (Q\u2080 T T' \u03f1 \u03b8 h\u03b8E h\u03b8F h\u03f1F) in\n/-- The quantization `Q(a) = \u2211\u1d62 \u2211\u2c7c \u2211\u2096 Q\u1d62\u2c7c\u2096(a)` of smooth homogeneous `Hom(E, F)`-valued symbols,\nthe sum of the terms `TauCeti.sectionQuantizationTerm`. -/\nprivate def sectionQuantization :\n sectionHomogeneousCotangentSymbols n V E W F m \u2192\u2097[\u2102]\n (C\u209b^\u221e\u27ee\ud835\udcd8(\u211d, CoordinateSpace n); V, E\u27ef \u2192\u2097[\u2102] C\u209b^\u221e\u27ee\ud835\udcd8(\u211d, CoordinateSpace n); W, F\u27ef) where\n toFun a := \u2211 i, \u2211 j, \u2211 k, sectionQuantizationTerm Q\u2080 T T' \u03f1 \u03b8 h\u03b8E h\u03b8F h\u03f1F i j k a\n map_add' a a' := by\n simp only [sectionQuantizationTerm, map_add, LinearMap.add_comp, LinearMap.comp_add,\n Finset.sum_add_distrib]\n map_smul' z a := by\n simp only [sectionQuantizationTerm, map_smul, LinearMap.smul_comp, LinearMap.comp_smul,\n Finset.smul_sum, RingHom.id_apply]\n\nomit [T2Space M] [IsManifold \ud835\udcd8(\u211d, CoordinateSpace n) \u221e M] in\n/-- The quantization is the sum of its terms. -/\nprivate theorem sectionQuantization_apply (a : sectionHomogeneousCotangentSymbols n V E W F m) :\n sectionQuantization Q\u2080 T T' \u03f1 \u03b8 h\u03b8E h\u03b8F h\u03f1F a =\n \u2211 i, \u2211 j, \u2211 k, sectionQuantizationTerm Q\u2080 T T' \u03f1 \u03b8 h\u03b8E h\u03b8F h\u03f1F i j k a :=\n rfl\n\nomit [IsManifold \ud835\udcd8(\u211d, CoordinateSpace n) \u221e M] in\n/-- The quantization of every symbol is a classical pseudodifferential operator of order `m`. -/\nprivate theorem sectionQuantization_mem (hQ\u2080 : \u2200 a, Q\u2080 a \u2208 classicalPseudodifferentialOperators m)\n (a : sectionHomogeneousCotangentSymbols n V E W F m) :\n sectionQuantization Q\u2080 T T' \u03f1 \u03b8 h\u03b8E h\u03b8F h\u03f1F a \u2208\n sectionClassicalPseudodifferentialOperators m := by\n rw [sectionQuantization_apply]\n exact Submodule.sum_mem _ fun i _ \u21a6 Submodule.sum_mem _ fun j _ \u21a6 Submodule.sum_mem _ fun k _ \u21a6\n sectionQuantizationTerm_mem hQ\u2080 i j k a\n\n/-- The quantization inverts the principal symbol map when `Q\u2080` does, the `\u03f1\u1d62` add up to `1` and\n`\u03b8\u1d62 = 1` on the support of `\u03f1\u1d62`. -/\nprivate theorem sectionClassicalPrincipalSymbol_sectionQuantization\n (hQ\u2080 : \u2200 a, Q\u2080 a \u2208 classicalPseudodifferentialOperators m)\n (hQ\u2080a : \u2200 a, classicalPrincipalSymbol m (Q\u2080 a) = a) (h\u03f1 : \u2200 x, \u2211 i, \u03f1 i x = 1)\n (h\u03b8\u03f1 : \u2200 i, \u2200 x \u2208 tsupport (\u03f1 i), \u03b8 i x = 1)\n (a : sectionHomogeneousCotangentSymbols n V E W F m) :\n sectionClassicalPrincipalSymbol m (sectionQuantization Q\u2080 T T' \u03f1 \u03b8 h\u03b8E h\u03b8F h\u03f1F a) = a := by\n ext x \u03be u\n rw [sectionQuantization_apply, sectionClassicalPrincipalSymbol_sum _ fun i _ \u21a6\n Submodule.sum_mem _ fun j _ \u21a6 Submodule.sum_mem _ fun k _ \u21a6\n sectionQuantizationTerm_mem hQ\u2080 i j k a, LinearMap.sum_apply]\n -- Over the `i`-th trivializations the terms have principal symbol `\u03f1\u1d62 a`.\n simp only [sectionQuantizationTerm,\n sectionClassicalPrincipalSymbol_sum_sum_toSpanSingleton_comp_comp_cutoffFrameCoeff (T _)\n (T' _) (\u03f1 _) (\u03b8 _) (h\u03b8E _) (h\u03b8F _) (h\u03b8\u03f1 _) (fun _ _ \u21a6 hQ\u2080 _)\n (fun _ _ \u21a6 (hQ\u2080a _).trans (coe_sectionSymbolReading_apply _ _ _ _ _ _ _ _ a)),\n LinearMap.smul_apply]\n rw [\u2190 Finset.sum_smul, \u2190 Complex.ofReal_sum, h\u03f1 x, Complex.ofReal_one, one_smul]\n\ninclude h\u03c8 h\u03c1\u03c8 h\u03c6\u2080 in\n/-- The quantization is continuous when `Q\u2080` is continuous for the chart partition `\u03c6\u2080\u1d62` in the\ncharts `c\u1d62`. -/\nprivate theorem continuous_sectionChartSobolevExtension_sectionQuantization\n (hQ\u2080 : \u2200 a, Q\u2080 a \u2208 classicalPseudodifferentialOperators m) (hq : q \u2264 s - m) {X : Type*}\n [TopologicalSpace X]\n (hQ\u2080c : \u2200 {a : X \u2192 homogeneousCotangentSymbols n M m},\n (\u2200 (e\u2080 : OpenPartialHomeomorph M (CoordinateSpace n))\n (he\u2080 : e\u2080 \u2208 IsManifold.maximalAtlas \ud835\udcd8(\u211d, CoordinateSpace n) \u221e M)\n (\u03b8\u2080 : \ud835\udcd3(\u27e8e\u2080.target, e\u2080.open_target\u27e9, \u211d)),\n Continuous fun y \u21a6 e\u2080.chartHomogeneousSymbol he\u2080 \u03b8\u2080 (a y).property) \u2192\n Continuous fun y \u21a6 chartSobolevExtension hc \u03c6\u2080 hc \u03c6\u2080 (Q\u2080 (a y)) s q)\n {a : X \u2192 sectionHomogeneousCotangentSymbols n V E W F m}\n (ha : \u2200 (t\u2080 : Trivialization V (\u03c0 V E)) [MemTrivializationAtlas t\u2080]\n (\u03c8\u2080 : C^\u221e\u27ee\ud835\udcd8(\u211d, CoordinateSpace n), M; \u211d\u27ef) (h\u03c8\u2080 : tsupport \u03c8\u2080 \u2286 t\u2080.baseSet) (v : V)\n (t\u2080' : Trivialization W (\u03c0 W F)) [MemTrivializationAtlas t\u2080']\n (\u03c7\u2080 : C^\u221e\u27ee\ud835\udcd8(\u211d, CoordinateSpace n), M; \u211d\u27ef) (h\u03c7\u2080 : tsupport \u03c7\u2080 \u2286 t\u2080'.baseSet)\n (\u2113 : W \u2192L[\u2102] \u2102) (e\u2080 : OpenPartialHomeomorph M (CoordinateSpace n))\n (he\u2080 : e\u2080 \u2208 IsManifold.maximalAtlas \ud835\udcd8(\u211d, CoordinateSpace n) \u221e M)\n (\u03b8\u2080 : \ud835\udcd3(\u27e8e\u2080.target, e\u2080.open_target\u27e9, \u211d)),\n Continuous fun y \u21a6 e\u2080.chartHomogeneousSymbol he\u2080 \u03b8\u2080\n (mem_sectionHomogeneousCotangentSymbols_iff.1 (a y).property t\u2080 \u03c8\u2080 h\u03c8\u2080 v t\u2080' \u03c7\u2080 h\u03c7\u2080\n \u2113)) :\n Continuous fun y \u21a6 sectionChartSobolevExtension he \u03c8 t \u03c1 h\u03c1 b he' \u03c6 t' \u03c7 h\u03c7 b'\n (sectionQuantization Q\u2080 T T' \u03f1 \u03b8 h\u03b8E h\u03b8F h\u03f1F (a y)) s q := by\n have hmem := sectionQuantizationTerm_mem (T := T) (T' := T') (\u03f1 := \u03f1) (\u03b8 := \u03b8) (h\u03b8E := h\u03b8E)\n (h\u03b8F := h\u03b8F) (h\u03f1F := h\u03f1F) hQ\u2080\n simp_rw [sectionQuantization_apply,\n sectionChartSobolevExtension_sum_of_mem _ (fun i _ \u21a6 Submodule.sum_mem _ fun j _ \u21a6\n Submodule.sum_mem _ fun k _ \u21a6 hmem i j k _) h\u03c8 h\u03c1\u03c8 hq,\n sectionChartSobolevExtension_sum_of_mem _ (fun j _ \u21a6 Submodule.sum_mem _ fun k _ \u21a6\n hmem _ j k _) h\u03c8 h\u03c1\u03c8 hq,\n sectionChartSobolevExtension_sum_of_mem _ (fun k _ \u21a6 hmem _ _ k _) h\u03c8 h\u03c1\u03c8 hq]\n refine continuous_finsetSum _ fun i _ \u21a6 continuous_finsetSum _ fun j _ \u21a6\n continuous_finsetSum _ fun k _ \u21a6 ?_\n -- Each term is a scalar quantization tensored with cut-off frames.\n exact continuous_sectionChartSobolevExtension_toSpanSingleton_comp_comp_cutoffFrameCoeff h\u03c8 h\u03c1\u03c8\n h\u03c6\u2080 h\u03c6\u2080 (fun _ \u21a6 hQ\u2080 _) hq (hQ\u2080c fun e\u2080 he\u2080 \u03b8\u2080 \u21a6 ha (T i) (\u03b8 i) (h\u03b8E i) (finBasis \u2102 V k)\n (T' i) (\u03f1 i) (h\u03f1F i) ((finBasis \u2102 W).coord j).toContinuousLinearMap e\u2080 he\u2080 \u03b8\u2080) _ _ _ _ _\n\nend Quantization\n\n", "statement": "/-- **A continuous linear quantization of principal symbols between bundles.** On a compact\nmanifold there is a linear map `Q` from the smooth positively homogeneous `Hom(E, F)`-valued\nsymbols of degree `m` on the cotangent bundle to the classical pseudodifferential operators of order\n`m` from `\u0393(E)` to `\u0393(F)` that inverts the principal symbol map, `\u03c3_m(Q(a)) = a`, and is\ncontinuous: for every family `y \u21a6 a y` whose readings `\u03c7(x) \u03c8(x) \u2113(t'\u2093 (a_y(x, \u03be) (t\u207b\u00b9\u2093 v)))` in all\ntrivializations, read in every chart of the maximal atlas and localized by every cutoff, depend\ncontinuously on `y` as homogeneous symbols, the extensions `H^s(M; E) \u2192 H^q(M; F)`, `q \u2264 s - m`,\nof the operators `Q(a y)` depend continuously on `y` in the operator norm, for the Sobolev spaces of\nall chart and frame data. -/\ntheorem exists_linearMap_sectionClassicalPrincipalSymbol_eq_and_continuous [CompactSpace M] :\n \u2203 Q : sectionHomogeneousCotangentSymbols n V E W F m \u2192\u2097[\u2102]\n (C\u209b^\u221e\u27ee\ud835\udcd8(\u211d, CoordinateSpace n); V, E\u27ef \u2192\u2097[\u2102] C\u209b^\u221e\u27ee\ud835\udcd8(\u211d, CoordinateSpace n); W, F\u27ef),\n (\u2200 a, Q a \u2208 sectionClassicalPseudodifferentialOperators m) \u2227\n (\u2200 a, sectionClassicalPrincipalSymbol m (Q a) = a) \u2227\n \u2200 {\u03b9 \u03ba \u03bd \u03bc : Type*} [Fintype \u03b9] [Fintype \u03ba] [Fintype \u03bd] [Fintype \u03bc]\n {e : \u03ba \u2192 OpenPartialHomeomorph M (CoordinateSpace n)}\n {he : \u2200 i, e i \u2208 IsManifold.maximalAtlas \ud835\udcd8(\u211d, CoordinateSpace n) \u221e M}\n {\u03c8 : \u2200 i, \ud835\udcd3(\u27e8(e i).target, (e i).open_target\u27e9, \u211d)} {t : \u03ba \u2192 Trivialization V (\u03c0 V E)}\n [\u2200 i, MemTrivializationAtlas (t i)] {\u03c1 : \u03ba \u2192 C^\u221e\u27ee\ud835\udcd8(\u211d, CoordinateSpace n), M; \u211d\u27ef}\n {h\u03c1 : \u2200 i, tsupport (\u03c1 i) \u2286 (t i).baseSet} {b : Module.Basis \u03b9 \u2102 V}\n {e' : \u03bd \u2192 OpenPartialHomeomorph M (CoordinateSpace n)}\n {he' : \u2200 j, e' j \u2208 IsManifold.maximalAtlas \ud835\udcd8(\u211d, CoordinateSpace n) \u221e M}\n {\u03c6 : \u2200 j, \ud835\udcd3(\u27e8(e' j).target, (e' j).open_target\u27e9, \u211d)}\n {t' : \u03bd \u2192 Trivialization W (\u03c0 W F)} [\u2200 j, MemTrivializationAtlas (t' j)]\n {\u03c7 : \u03bd \u2192 C^\u221e\u27ee\ud835\udcd8(\u211d, CoordinateSpace n), M; \u211d\u27ef}\n {h\u03c7 : \u2200 j, tsupport (\u03c7 j) \u2286 (t' j).baseSet} {b' : Module.Basis \u03bc \u2102 W} {s q : \u211d},\n (\u2200 x, \u2211 i, (e i).cutoffPullback (he i) (\u03c8 i) 1 x = 1) \u2192\n (\u2200 i, \u2200 y \u2208 tsupport (\u03c8 i), \u03c1 i ((e i).symm y) = 1) \u2192 q \u2264 s - m \u2192\n \u2200 {X : Type*} [TopologicalSpace X] {a : X \u2192 sectionHomogeneousCotangentSymbols n V E W F m},\n (\u2200 (t\u2080 : Trivialization V (\u03c0 V E)) [MemTrivializationAtlas t\u2080]\n (\u03c8\u2080 : C^\u221e\u27ee\ud835\udcd8(\u211d, CoordinateSpace n), M; \u211d\u27ef) (h\u03c8\u2080 : tsupport \u03c8\u2080 \u2286 t\u2080.baseSet) (v : V)\n (t\u2080' : Trivialization W (\u03c0 W F)) [MemTrivializationAtlas t\u2080']\n (\u03c7\u2080 : C^\u221e\u27ee\ud835\udcd8(\u211d, CoordinateSpace n), M; \u211d\u27ef) (h\u03c7\u2080 : tsupport \u03c7\u2080 \u2286 t\u2080'.baseSet)\n (\u2113 : W \u2192L[\u2102] \u2102) (e\u2080 : OpenPartialHomeomorph M (CoordinateSpace n))\n (he\u2080 : e\u2080 \u2208 IsManifold.maximalAtlas \ud835\udcd8(\u211d, CoordinateSpace n) \u221e M)\n (\u03b8\u2080 : \ud835\udcd3(\u27e8e\u2080.target, e\u2080.open_target\u27e9, \u211d)),\n Continuous fun y \u21a6 e\u2080.chartHomogeneousSymbol he\u2080 \u03b8\u2080\n (mem_sectionHomogeneousCotangentSymbols_iff.1 (a y).property t\u2080 \u03c8\u2080 h\u03c8\u2080 v t\u2080' \u03c7\u2080 h\u03c7\u2080\n \u2113)) \u2192\n Continuous fun y \u21a6 sectionChartSobolevExtension he \u03c8 t \u03c1 h\u03c1 b he' \u03c6 t' \u03c7 h\u03c7 b'\n (Q (a y)) s q ", "proof": " by\n obtain \u27e8Q\u2080, hQ\u2080, hQ\u2080a, hQ\u2080c\u27e9 :=\n exists_linearMap_classicalPrincipalSymbol_eq_and_continuous (n := n) (M := M) (m := m)\n -- A finite partition of unity `\u03f1\u1d62` subordinate to the common base sets of the trivializations\n -- of `E` and `F` at points `x\u1d62`, and cutoffs `\u03b8\u1d62` equal to `1` near the supports of the `\u03f1\u1d62`.\n obtain \u27e8\u03b3, _, f, hf\u27e9 := (isCompact_univ (X := M)).exists_smoothBumpCovering_isSubordinate\n \ud835\udcd8(\u211d, CoordinateSpace n)\n (U := fun x \u21a6 (trivializationAt V E x).baseSet \u2229 (trivializationAt W F x).baseSet)\n fun x _ \u21a6 Filter.inter_mem ((trivializationAt V E x).open_baseSet.mem_nhds\n (FiberBundle.mem_baseSet_trivializationAt V E x))\n ((trivializationAt W F x).open_baseSet.mem_nhds\n (FiberBundle.mem_baseSet_trivializationAt W F x))\n set \u03f1 := f.toSmoothPartitionOfUnity\n have h\u03f1c (i : \u03b3) : IsCompact (tsupport (\u03f1 i)) :=\n (f i).hasCompactSupport.isCompact.of_isClosed_subset (isClosed_tsupport _)\n (closure_mono (f.support_toSmoothPartitionOfUnity_subset i))\n choose \u03b8 h\u03b8 h\u03b8\u2081 _ h\u03b8t _ using fun i \u21a6 (h\u03f1c i).exists_contMDiff_one_nhds_tsupport_subset\n \ud835\udcd8(\u211d, CoordinateSpace n) ((trivializationAt V E (f.c i)).open_baseSet.inter\n (trivializationAt W F (f.c i)).open_baseSet) (hf.toSmoothPartitionOfUnity i)\n refine \u27e8sectionQuantization Q\u2080 (fun i \u21a6 trivializationAt V E (f.c i))\n (fun i \u21a6 trivializationAt W F (f.c i)) (fun i \u21a6 \u03f1 i) (fun i \u21a6 \u27e8\u03b8 i, h\u03b8 i\u27e9)\n (fun i \u21a6 (h\u03b8t i).trans inter_subset_left) (fun i \u21a6 (h\u03b8t i).trans inter_subset_right)\n (fun i \u21a6 (hf.toSmoothPartitionOfUnity i).trans inter_subset_right),\n sectionQuantization_mem hQ\u2080, sectionClassicalPrincipalSymbol_sectionQuantization hQ\u2080 hQ\u2080a\n (fun x \u21a6 by simpa [\u2190 finsum_eq_sum_of_fintype] using \u03f1.sum_eq_one (mem_univ x))\n (fun i x hx \u21a6 (h\u03b8\u2081 i).self_of_nhdsSet x hx),\n fun h\u03c8 h\u03c1\u03c8 hq _ _ _ ha \u21a6 ?_\u27e9\n -- Continuity, through the continuity of `Q\u2080` for a chart partition of `M`.\n obtain \u27e8N, x\u2080, \u03c6\u2080, h\u03c6\u2080\u27e9 := (isCompact_univ (X := M)).exists_sum_cutoffPullback_eq_one\n (E := CoordinateSpace n)\n have h\u03c6\u2080' (x : M) := h\u03c6\u2080 x (mem_univ x)\n exact continuous_sectionChartSobolevExtension_sectionQuantization h\u03c8 h\u03c1\u03c8 h\u03c6\u2080' hQ\u2080 hq\n (fun ha\u2080 \u21a6 hQ\u2080c h\u03c6\u2080' hq ha\u2080) ha", "proof_lines": 32, "proof_length": 1812, "rev": "75c8aed5fea63047615a25a9763fd5b68a86e891", "heartbeats": 19134, "image": "lean-compression:tauceti-75c8aed5fe-a608030cfc", "split": "dev"} {"path": "TauCeti/Algebra/Lie/GeneralLinear/Finrank.lean", "module": "TauCeti.Algebra.Lie.GeneralLinear.Finrank", "theorem": "TauCeti.finrank_ker_ad_sl_add_one", "prefix": "/-\nCopyright (c) 2026 The Tau Ceti contributors. All rights reserved.\nReleased under Apache 2.0 license as described in the file LICENSE.\nAuthors: The Tau Ceti contributors\n-/\nmodule\n\npublic import TauCeti.Algebra.Lie.GeneralLinear.Basic\n\nimport Mathlib.LinearAlgebra.Dimension.Finite\nimport TauCeti.LinearAlgebra.Dual.Lemmas\n\n/-!\n# The dimension of the special linear Lie algebra\n\nThe trace-zero matrices `sl n R` form a finite free module over any commutative ring. For a\nnonempty finite index type, the entries away from one diagonal place are free coordinates: the\ntrace-zero condition determines the remaining entry as minus the sum of the other diagonal entries.\nFor an empty index type, `sl n R` is the zero module.\n\nOver a nontrivial commutative ring, the strong rank condition gives\n`finrank R (sl n R) = (Fintype.card n) ^ 2 - 1`. Truncated subtraction includes the empty case;\n`TauCeti.finrank_sl_add_one` gives the untruncated formula when the index type is nonempty.\n\n## Main results\n\n* `TauCeti.finrank_sl`: `sl n R` has rank `(card n) ^ 2 - 1`.\n* `TauCeti.finrank_sl_add_one`: the untruncated form, for a nonempty index type.\n* `TauCeti.finrank_inf_sl_add_one`: over a field in which the size of the matrices is nonzero, a\n subspace of matrices containing the identity meets `sl n K` in codimension one.\n* `TauCeti.finrank_ker_ad_sl_add_one`: applied to a centralizer, the centralizer of `x` in\n `sl n K` has codimension one in its centralizer in `gl n K`.\n\nThe same coordinate system also gives the `Module.Free` and `Module.Finite` instances for `sl n R`\nthat any rank computation involving it needs; over a commutative ring these do not come for free\nfrom finiteness of the matrices.\n\n## Implementation notes\n\n`specialLinearEntryEquiv` identifies `sl n R` with the entries away from one diagonal place.\nFreeness, finiteness and dimension follow by transporting the corresponding facts about this\nfunction space. Membership is read through `LieAlgebra.SpecialLinear.mem_sl_iff`.\n-/\n\npublic section\n\nnamespace TauCeti\n\nopen Matrix Module LieAlgebra\n\nattribute [local instance 100] LieRing.ofAssociativeRing\n\nvariable {R : Type*} {n : Type*} [Fintype n] [DecidableEq n]\n\nsection Coordinates\n\nvariable [CommRing R] (i\u2080 : n)\n\n/-- The diagonal place `(k, k)`, for `k \u2260 i\u2080`, as one of the free coordinates of a trace-zero\nmatrix. -/\nprivate def diagIdx (k : {k : n // k \u2260 i\u2080}) : {p : n \u00d7 n // p \u2260 (i\u2080, i\u2080)} :=\n \u27e8(k.val, k.val), fun hk => k.property (congrArg Prod.fst hk)\u27e9\n\n/-- A trace-zero matrix is determined by its entries away from `(i\u2080, i\u2080)`. -/\ndef specialLinearEntryEquiv : SpecialLinear.sl n R \u2243\u2097[R] ({p : n \u00d7 n // p \u2260 (i\u2080, i\u2080)} \u2192 R) where\n toFun A p := A.val p.val.1 p.val.2\n map_add' _ _ := rfl\n map_smul' _ _ := rfl\n invFun g := \u27e8Matrix.of fun i j =>\n if h : (i, j) = (i\u2080, i\u2080) then -\u2211 k : {k : n // k \u2260 i\u2080}, g (diagIdx i\u2080 k)\n else g \u27e8(i, j), h\u27e9, by\n rw [SpecialLinear.mem_sl_iff]\n simp only [Matrix.trace, Matrix.diag_apply, Matrix.of_apply]\n rw [Fintype.sum_eq_add_sum_subtype_ne _ i\u2080]\n simp only [Prod.mk.injEq, and_self, dite_true]\n apply neg_add_eq_zero.mpr\n apply Finset.sum_congr rfl\n intro k _\n rw [dite_eq_right k.property]\n rfl\u27e9\n left_inv A := by\n apply Subtype.ext\n ext i j\n simp only [Matrix.of_apply]\n split\n \u00b7 rename_i h\n obtain \u27e8hi, hj\u27e9 := Prod.mk.inj h\n subst i j\n have hA := SpecialLinear.mem_sl_iff.mp A.property\n simp only [Matrix.trace, Matrix.diag_apply] at hA\n rw [Fintype.sum_eq_add_sum_subtype_ne _ i\u2080] at hA\n exact neg_eq_of_add_eq_zero_left hA\n \u00b7 rfl\n right_inv g := by\n funext p\n exact dite_eq_right p.property\n\n/-- The free entry coordinates read the corresponding matrix entries. -/\n@[simp]\ntheorem specialLinearEntryEquiv_apply (X : SpecialLinear.sl n R)\n (p : {p : n \u00d7 n // p \u2260 (i\u2080, i\u2080)}) :\n specialLinearEntryEquiv (R := R) i\u2080 X p = X.val p.val.1 p.val.2 := by\n rfl\n\n\n/-- Away from the omitted diagonal place, the inverse reads the free entry coordinate. -/\n@[simp]\ntheorem specialLinearEntryEquiv_symm_apply_of_ne\n (g : {p : n \u00d7 n // p \u2260 (i\u2080, i\u2080)} \u2192 R) {i j : n} (h : (i, j) \u2260 (i\u2080, i\u2080)) :\n ((specialLinearEntryEquiv (R := R) i\u2080).symm g).val i j = g \u27e8(i, j), h\u27e9 := by\n exact congrFun ((specialLinearEntryEquiv (R := R) i\u2080).apply_symm_apply g) \u27e8(i, j), h\u27e9\n\n/-- The omitted diagonal entry is minus the sum of the other diagonal coordinates. -/\n@[simp]\ntheorem specialLinearEntryEquiv_symm_apply_self\n (g : {p : n \u00d7 n // p \u2260 (i\u2080, i\u2080)} \u2192 R) :\n ((specialLinearEntryEquiv (R := R) i\u2080).symm g).val i\u2080 i\u2080 =\n -\u2211 k : {k : n // k \u2260 i\u2080},\n g \u27e8(k.val, k.val), fun h => k.property (congrArg Prod.fst h)\u27e9 := by\n have htrace := SpecialLinear.mem_sl_iff.mp\n ((specialLinearEntryEquiv (R := R) i\u2080).symm g).property\n simp only [Matrix.trace, Matrix.diag_apply] at htrace\n rw [Fintype.sum_eq_add_sum_subtype_ne _ i\u2080] at htrace\n have hdiag (k : {k : n // k \u2260 i\u2080}) :\n ((specialLinearEntryEquiv (R := R) i\u2080).symm g).val k.val k.val =\n g \u27e8(k.val, k.val), fun h => k.property (congrArg Prod.fst h)\u27e9 :=\n specialLinearEntryEquiv_symm_apply_of_ne i\u2080 g fun h => k.property (congrArg Prod.fst h)\n simp only [hdiag] at htrace\n exact (neg_eq_of_add_eq_zero_left htrace).symm\n\nend Coordinates\n\nsection FreeFinite\n\nvariable [CommRing R]\n\n/-- **`sl n R` is a free module.** For a nonempty index type the coordinates above are a basis of\nit; for an empty one it is the zero module. -/\ninstance : Module.Free R (SpecialLinear.sl n R) := by\n rcases isEmpty_or_nonempty n with hn | \u27e8\u27e8i\u2080\u27e9\u27e9\n \u00b7 infer_instance\n \u00b7 exact Module.Free.of_equiv (specialLinearEntryEquiv (R := R) i\u2080).symm\n\n/-- **`sl n R` is a finite module**, the coordinates above being finite in number. -/\ninstance : Module.Finite R (SpecialLinear.sl n R) := by\n rcases isEmpty_or_nonempty n with hn | \u27e8\u27e8i\u2080\u27e9\u27e9\n \u00b7 infer_instance\n \u00b7 exact Module.Finite.equiv (specialLinearEntryEquiv (R := R) i\u2080).symm\n\nend FreeFinite\n\nsection Finrank\n\nvariable (R n) [CommRing R] [StrongRankCondition R]\n\n/-- **The rank of `sl n R`**: `finrank R (sl n R) = (card n) ^ 2 - 1`.\n\nFor an empty index type the matrix algebra is trivial and both sides are `0`, the truncated\nsubtraction `0 - 1` doing the work. -/\n@[simp]\ntheorem finrank_sl :\n finrank R (SpecialLinear.sl n R) = Fintype.card n ^ 2 - 1 := by\n rcases isEmpty_or_nonempty n with hn | \u27e8\u27e8i\u2080\u27e9\u27e9\n \u00b7 simp [Module.finrank_zero_of_subsingleton]\n \u00b7 rw [(specialLinearEntryEquiv (R := R) i\u2080).finrank_eq]\n simp [Fintype.card_subtype_compl, sq]\n\nvariable [Nonempty n]\n\n/-- The untruncated codimension-one statement: `sl n R` is a hyperplane in the matrices. -/\ntheorem finrank_sl_add_one :\n finrank R (SpecialLinear.sl n R) + 1 = Fintype.card n ^ 2 := by\n have hpos : 1 \u2264 Fintype.card n ^ 2 := Nat.one_le_pow _ _ Fintype.card_pos\n rw [finrank_sl]\n omega\n\nend Finrank\n\nsection Field\n\nvariable {K : Type*} [Field K]\n\n/-- A subspace of square matrices containing the identity meets `sl n K` in codimension one, when\nthe size of the matrices is nonzero in `K`: the trace does not vanish on it, since the identity\nhas trace `Fintype.card n`. -/\ntheorem finrank_inf_sl_add_one (hn : (Fintype.card n : K) \u2260 0) {A : Submodule K (Matrix n n K)}\n (hA : (1 : Matrix n n K) \u2208 A) :\n finrank K \u21a5(A \u2293 (SpecialLinear.sl n K).toSubmodule) + 1 = finrank K A := by\n have hsl : (SpecialLinear.sl n K).toSubmodule = LinearMap.ker (Matrix.traceLinearMap n K K) := by\n ext Y\n simp [SpecialLinear.mem_sl_iff]\n rw [inf_comm, hsl]\n exact Module.Dual.finrank_ker_inf_add_one fun h \u21a6 hn (by simpa using h hA)\n\n", "statement": "/-- **Centralizers in `sl n` and `gl n`.** When the size of the matrices is nonzero in `K`, the\ncentralizer of `x \u2208 sl n K` in `sl n K` has codimension one in its centralizer in `gl n K`. -/\ntheorem finrank_ker_ad_sl_add_one (hn : (Fintype.card n : K) \u2260 0) (x : SpecialLinear.sl n K) :\n finrank K (LinearMap.ker (ad K (SpecialLinear.sl n K) x)) + 1 =\n finrank K (LinearMap.ker (ad K (Matrix n n K) (x : Matrix n n K))) ", "proof": " by\n have hmap : (LinearMap.ker (ad K (SpecialLinear.sl n K) x)).map\n ((SpecialLinear.sl n K).incl : SpecialLinear.sl n K \u2192\u2097[K] Matrix n n K) =\n LinearMap.ker (ad K (Matrix n n K) (x : Matrix n n K)) \u2293\n (SpecialLinear.sl n K).toSubmodule := by\n ext Y\n simp only [Submodule.mem_map, LinearMap.mem_ker, ad_apply, LieHom.coe_toLinearMap,\n LieSubalgebra.coe_incl, Submodule.mem_inf, LieSubalgebra.mem_toSubmodule]\n constructor\n \u00b7 rintro \u27e8y, hy, rfl\u27e9\n exact \u27e8by simpa using congrArg Subtype.val hy, y.property\u27e9\n \u00b7 rintro \u27e8hY, hYsl\u27e9\n exact \u27e8\u27e8Y, hYsl\u27e9, Subtype.ext (by simpa using hY), rfl\u27e9\n have h1 : (1 : Matrix n n K) \u2208 LinearMap.ker (ad K (Matrix n n K) (x : Matrix n n K)) := by\n simp [LieRing.of_associative_ring_bracket]\n rw [\u2190 finrank_inf_sl_add_one hn h1, \u2190 hmap,\n (Submodule.equivMapOfInjective\n ((SpecialLinear.sl n K).incl : SpecialLinear.sl n K \u2192\u2097[K] Matrix n n K)\n (fun _ _ h \u21a6 Subtype.ext h) _).finrank_eq]", "proof_lines": 18, "proof_length": 895, "rev": "75c8aed5fea63047615a25a9763fd5b68a86e891", "heartbeats": 3487, "image": "lean-compression:tauceti-75c8aed5fe-a608030cfc", "split": "dev"} {"path": "TauCeti/GroupTheory/SpecificGroups/Dihedral/Frobenius.lean", "module": "TauCeti.GroupTheory.SpecificGroups.Dihedral.Frobenius", "theorem": "TauCeti.fixedPointFree_conjNormal_dihedralRotations", "prefix": "/-\nCopyright (c) 2026 The Tau Ceti contributors. All rights reserved.\nReleased under Apache 2.0 license as described in the file LICENSE.\nAuthors: The Tau Ceti contributors\n-/\nmodule\n\npublic import TauCeti.GroupTheory.FrobeniusKernel\npublic import TauCeti.GroupTheory.SpecificGroups.Dihedral.Basic\nimport Mathlib.Tactic.LinearCombination\n\n/-!\n# The odd dihedral groups of degree `n > 1` are Frobenius groups\n\nAt every degree, `DihedralGroup n` is the semidirect product `C_n \u22ca C\u2082` of its rotation subgroup by\nthe two-element subgroup generated by any one reflection. What oddness of `n` adds is that the\nreflection subgroup then meets each of its distinct conjugates trivially; that and its\nnontriviality hold at every odd `n`, including `n = 1`. Once `n > 1` the reflection subgroup is in\naddition proper, and the decomposition exhibits `DihedralGroup n` as a **Frobenius group**. The\nexcluded degree `n = 1` is the two-element group, where the reflection subgroup is the whole group.\n\nThe decomposition itself is already in place, in\n`TauCeti.GroupTheory.SpecificGroups.Dihedral.Basic`: the rotation subgroup\n`TauCeti.dihedralRotations` is normal, the subgroup generated by a reflection is `{1, sr i}`\n(`TauCeti.mem_zpowers_dihedralSr_iff`), and the two are complementary at every degree\n(`TauCeti.isComplement'_dihedralRotations_zpowers_sr`) -- the infinite dihedral group is\n`\u2124 \u22ca C\u2082` just as much as `D\u2084 = C\u2084 \u22ca C\u2082` and `D\u2083 = C\u2083 \u22ca C\u2082`. Oddness enters only in the\ntrivial-intersection half, which is what this file adds: it is the fixed-point-free\ncriterion `TauCeti.isTISubgroup_of_sup_eq_top_of_fixedPointFree`, whose hypothesis is the\ndefining dihedral relation: conjugation by a reflection inverts every rotation\n(`TauCeti.conjNormal_eq_inv_of_notMem_dihedralRotations`), and a rotation equal to its own inverse\nhas order dividing `2`, hence order `1` when `n` is odd.\n\nThat is already enough to identify the Frobenius kernel as a *set*: for a finite group, a normal\ncomplement to a trivial-intersection subgroup is exactly the set of elements lying in no conjugate\nof that subgroup (`TauCeti.IsTISubgroup.coe_eq_frobeniusKernel_of_isComplement'`), so\n`TauCeti.frobeniusKernel_zpowers_dihedralSr` is elementary and belongs here. What needs Frobenius's\ntheorem, and hence the character theory, is that the *subgroup* the theorem constructs out of the\ntrivial-intersection property alone is the rotation subgroup; that identification is\n`TauCeti/RepresentationTheory/FrobeniusGroup/Dihedral.lean`.\n\n**Oddness is load-bearing there, not cosmetic.** For even `n > 0` the rotation `r (n/2)` is central\nand is neither the identity nor a reflection, so it normalizes the reflection subgroup while lying\noutside it, and the trivial-intersection property fails;\n`TauCeti.not_isTISubgroup_zpowers_dihedralSr` records that failure at every such degree. That is a\nstatement about the *finite* dihedral groups only. At the remaining even degree `n = 0` the\nrotation `r (n/2)` is the identity, and the reflection subgroup of the infinite dihedral group\nreally is a trivial-intersection subgroup: conjugating `sr i` by `r k` gives `sr (i - 2k)` and by\n`sr j` gives `sr (2j - i)`, and over `ZMod 0 = \u2124` neither returns `sr i` unless the conjugator\nalready lies in the subgroup.\n\n## Main results\n\n* `TauCeti.fixedPointFree_conjNormal_dihedralRotations`: for odd `n`, conjugation by a reflection\n fixes no rotation but the identity.\n* `TauCeti.isTISubgroup_zpowers_dihedralSr`: for odd `n`, the subgroup generated by a reflection is\n a trivial-intersection subgroup.\n* `TauCeti.isFrobeniusComplement_zpowers_dihedralSr`: **for odd `n > 1` it is a Frobenius\n complement**, so `DihedralGroup n` is a Frobenius group.\n* `TauCeti.frobeniusKernel_zpowers_dihedralSr`: for odd `n`, the Frobenius kernel of that\n complement is, as a set, the rotation subgroup.\n* `TauCeti.not_isTISubgroup_zpowers_dihedralSr`: the negative control, at every positive even\n degree.\n\n## References\n\n* I. M. Isaacs, *Character Theory of Finite Groups*, AMS Chelsea (1976), Chapter 7, where the\n dihedral groups of odd degree are the standard first examples of Frobenius groups.\n* J.-P. Serre, *Linear Representations of Finite Groups*, Springer GTM 42 (1977), Chapter 5.3,\n where the dihedral groups appear with the same semidirect decomposition.\n-/\n\npublic section\n\nnamespace TauCeti\n\nvariable {n : \u2115}\n\n/-! ### The fixed-point-free action -/\n\n", "statement": "/-- **For odd `n`, conjugation by a reflection fixes no rotation but the identity.** Conjugation by\nanything outside the rotation subgroup inverts every rotation, so a fixed rotation is its own\ninverse and has order dividing `2`; its order also divides `n`, and `2` is prime to an odd `n`. -/\ntheorem fixedPointFree_conjNormal_dihedralRotations (hn : Odd n) {s : DihedralGroup n}\n (hs : s \u2209 dihedralRotations n) :\n MonoidHom.FixedPointFree (MulAut.conjNormal s : MulAut (dihedralRotations n)) ", "proof": " by\n intro x hx\n rw [conjNormal_eq_inv_of_notMem_dihedralRotations hs] at hx\n have hsq : x ^ 2 = 1 := by\n rw [pow_two]\n nth_rewrite 1 [\u2190 hx]\n exact inv_mul_cancel x\n have htwo : orderOf x \u2223 2 := orderOf_dvd_of_pow_eq_one hsq\n have hcard : orderOf x \u2223 n := by\n have hdvd := orderOf_dvd_natCard x\n rwa [card_dihedralRotations] at hdvd\n have hcop : Nat.Coprime (orderOf x) n :=\n Nat.Coprime.coprime_dvd_left htwo (Nat.coprime_two_left.mpr hn)\n exact orderOf_eq_one_iff.mp (hcop.eq_one_of_dvd hcard)", "proof_lines": 13, "proof_length": 481, "rev": "75c8aed5fea63047615a25a9763fd5b68a86e891", "heartbeats": 290, "image": "lean-compression:tauceti-75c8aed5fe-a608030cfc", "split": "dev"} {"path": "TauCeti/NumberTheory/LocalField/Frobenius.lean", "module": "TauCeti.NumberTheory.LocalField.Frobenius", "theorem": "TauCeti.frobeniusAlgEquiv_apply_of_pow_eq_one", "prefix": "/-\nCopyright (c) 2026 The Tau Ceti contributors. All rights reserved.\nReleased under Apache 2.0 license as described in the file LICENSE.\nAuthors: The Tau Ceti contributors\n-/\nmodule\n\npublic import TauCeti.NumberTheory.LocalField.ResidueCorrespondence\npublic import TauCeti.NumberTheory.LocalField.Teichmuller\npublic import Mathlib.RingTheory.Frobenius\n\n/-!\n# Frobenius in unramified local fields\n\nThe arithmetic Frobenius of a finite unramified extension is compatible with restriction through\na normal intermediate field. This identifies the Frobenius elements at different finite levels\nof an unramified tower, rather than merely identifying arbitrary generators of their cyclic Galois\ngroups. Under a change of ground field `K \u2286 K'`, the Frobenius of an unramified extension of `K'`\nrestricts to the power of the Frobenius over `K` by the residue degree of `K'/K`. The Teichm\u00fcller\nlifts of a residue element's Frobenius image and its power by the cardinality of the base residue\nfield agree. Frobenius raises prime-to-residue-characteristic roots of unity to that same power.\n\n## Main result\n\n* `TauCeti.frobeniusAlgEquiv_restrictNormal`: restricting arithmetic Frobenius to a normal\n intermediate field gives arithmetic Frobenius there.\n* `TauCeti.frobeniusAlgEquiv_restrictScalars_restrictNormal`: the arithmetic Frobenius of `L'/K'`\n restricts on `L \u2286 L'` to the `f(K'/K)`-th power of the arithmetic Frobenius of `L/K`.\n* `TauCeti.frobeniusAlgEquiv_teichmullerLift`: the Teichm\u00fcller lifts of the Frobenius action\n on a residue element and its `q`-th power agree.\n* `TauCeti.frobeniusAlgEquiv_rootsOfUnity`: on prime-to-residue-characteristic roots of\n unity, arithmetic Frobenius acts by the `q`-th power map.\n* `TauCeti.frobeniusAlgEquiv_apply_of_pow_eq_one`: the same holds for every root of unity whose\n order is invertible in `\ud835\udcaa[L]`, not only for the `(q_L \u2212 1)`-st roots of unity.\n* `TauCeti.frobeniusAlgEquiv_apply_of_pow_natCard_pow_eq_self`: it raises every root of\n `X^{q^g} \u2212 X` to the `q`-th power.\n\n## References\n\n* J.-P. Serre, *Local Fields*, Chapter III, \u00a75.\n* J. Neukirch, *Algebraic Number Theory*, Chapter II, \u00a77.\n-/\n\npublic section\nnoncomputable section\n\nopen ValuativeRel\n\nnamespace TauCeti\n\nsection Teichmuller\n\nvariable {K L : Type*}\n [Field K] [ValuativeRel K] [TopologicalSpace K] [IsNonarchimedeanLocalField K]\n [Field L] [ValuativeRel L] [TopologicalSpace L] [IsNonarchimedeanLocalField L]\n [Algebra K L] [ValuativeExtension K L] [FiniteDimensional K L] [IsGalois K L]\n\n/-- The Teichm\u00fcller lifts of the Frobenius action on `a` and of `a ^ q` agree,\nwhere `q` is the cardinality of the residue field of the base. -/\n@[simp]\ntheorem frobeniusAlgEquiv_teichmullerLift [IsUnramified K L] (a : \ud835\udcc0[L]) :\n teichmullerLift L (frobeniusAlgEquiv (K := K) (L := L) \u2022 a) =\n teichmullerLift L (a ^ Nat.card \ud835\udcc0[K]) := by\n congr 1\n have h := congrArg (fun e : \ud835\udcc0[L] \u2243\u2090[\ud835\udcc0[K]] \ud835\udcc0[L] \u21a6 e a)\n (residueField_toAlgEquiv_frobeniusAlgEquiv (K := K) (L := L))\n simpa only [MulSemiringAction.toAlgEquiv_apply,\n FiniteField.coe_frobeniusAlgEquivOfAlgebraic,\n Fintype.card_eq_nat_card] using h\n\n/-- Arithmetic Frobenius raises every `(q_L - 1)`-st root of unity in an unramified extension\nto the `q_K`-th power. -/\n@[simp]\ntheorem frobeniusAlgEquiv_rootsOfUnity [IsUnramified K L]\n (\u03b6 : rootsOfUnity (Nat.card \ud835\udcc0[L] - 1) L) :\n frobeniusAlgEquiv (K := K) (L := L) ((\u03b6 : L\u02e3) : L) =\n (((\u03b6 : L\u02e3) : L) ^ Nat.card \ud835\udcc0[K]) := by\n let a := rootsOfUnityAlgebraMulEquivUnitsResidueField \ud835\udcaa[L] L \u03b6\n have h\u03b6 : ((\u03b6 : L\u02e3) : L) = ((teichmullerLift L (a : \ud835\udcc0[L]) : \ud835\udcaa[L]) : L) := by\n rw [\u2190 coe_teichmuller_apply]\n exact (algebraMap_teichmuller_rootsOfUnityAlgebraMulEquivUnitsResidueField\n \ud835\udcaa[L] L \u03b6).symm\n rw [h\u03b6]\n rw [\u2190 AlgEquiv.coe_smul_integerRing, AlgEquiv.smul_teichmullerLift,\n frobeniusAlgEquiv_teichmullerLift,\n map_pow]\n exact (map_pow (algebraMap \ud835\udcaa[L] L) (teichmullerLift L (a : \ud835\udcc0[L]))\n (Nat.card \ud835\udcc0[K])).symm\n\n", "statement": "/-- **Arithmetic Frobenius on roots of unity of order prime to the residue characteristic.** In a\nfinite unramified Galois extension `L / K`, if `x ^ n = 1` for an `n` invertible in `\ud835\udcaa[L]`, then\n`Frob x = x ^ q`, where `q` is the cardinality of the residue field of `K`. -/\ntheorem frobeniusAlgEquiv_apply_of_pow_eq_one [IsUnramified K L] {n : \u2115}\n (hn : IsUnit (n : \ud835\udcaa[L])) {x : L} (hx : x ^ n = 1) :\n frobeniusAlgEquiv (K := K) (L := L) x = x ^ Nat.card \ud835\udcc0[K] ", "proof": " by\n have hn0 : n \u2260 0 := by\n rintro rfl\n simp at hn\n -- A root of unity has valuation `1`, so it is integral.\n have hxv : x \u2208 \ud835\udcaa[L] := (Valuation.mem_integer_iff _ _).2\n ((pow_le_one_iff_of_nonneg zero_le hn0).1 (by rw [\u2190 map_pow, hx, map_one]))\n -- `\ud835\udcc2[L]` lies over `\ud835\udcc2[K]`, the kernel of reduction `\ud835\udcaa[K] \u2192 \ud835\udcc0[K]`, so the quotient is `\ud835\udcc0[K]`.\n have hq : Nat.card (\ud835\udcaa[K] \u29f8 \ud835\udcc2[L].under \ud835\udcaa[K]) = Nat.card \ud835\udcc0[K] := by\n rw [\u2190 Ideal.over_def \ud835\udcc2[L] \ud835\udcc2[K], \u2190 IsLocalRing.ker_residue]\n exact Nat.card_congr\n (RingHom.quotientKerEquivOfSurjective IsLocalRing.residue_surjective).toEquiv\n -- Frobenius is an arithmetic Frobenius of `\ud835\udcaa[L] / \ud835\udcaa[K]` at the maximal ideal, so Mathlib's\n -- `AlgHom.IsArithFrobAt.apply_of_pow_eq_one` applies.\n have h\u03c3 : IsArithFrobAt \ud835\udcaa[K] (frobeniusAlgEquiv (K := K) (L := L)) \ud835\udcc2[L] := fun y \u21a6 by\n rw [hq]\n refine (Valuation.mem_maximalIdeal_iff (v := valuation L)).2 ?_\n rw [MulSemiringAction.toAlgHom_apply, AddSubgroupClass.coe_sub, SubmonoidClass.coe_pow,\n AlgEquiv.coe_smul_integerRing]\n exact valuation_frobeniusAlgEquiv_sub_pow (K := K) (L := L) y\n have h := h\u03c3.apply_of_pow_eq_one (\u03b6 := \u27e8x, hxv\u27e9)\n (Subtype.ext (by rw [SubmonoidClass.coe_pow, hx, OneMemClass.coe_one]))\n ((IsLocalRing.mem_maximalIdeal _).not.2 (not_not.2 hn))\n rw [hq, MulSemiringAction.toAlgHom_apply] at h\n have h' := congrArg Subtype.val h\n rwa [AlgEquiv.coe_smul_integerRing, SubmonoidClass.coe_pow] at h'", "proof_lines": 25, "proof_length": 1067, "rev": "75c8aed5fea63047615a25a9763fd5b68a86e891", "heartbeats": 4615, "image": "lean-compression:tauceti-75c8aed5fe-a608030cfc", "split": "dev"} {"path": "TauCeti/AlgebraicTopology/Singular/Cubical/Triangulation/Shuffle.lean", "module": "TauCeti.AlgebraicTopology.Singular.Cubical.Triangulation.Shuffle", "theorem": "TauCeti.integralShuffleStep_orderedChain", "prefix": "/-\nCopyright (c) 2026 The Tau Ceti contributors. All rights reserved.\nReleased under Apache 2.0 license as described in the file LICENSE.\nAuthors: The Tau Ceti contributors\n-/\nmodule\n\npublic import TauCeti.AlgebraicTopology.Singular.Cubical.Triangulation.Chains\npublic import TauCeti.AlgebraicTopology.Singular.Shuffle\npublic import Mathlib.Algebra.Category.ModuleCat.Monoidal.Closed\n\n/-!\n# Literal integral iterated shuffle\n\nThe comparison uses the actual singular shuffle with integral coefficients. It does not\nrequire or assert a tensor product on modules over a noncommutative coefficient ring.\n\n## Main definitions and results\n\n* `TauCeti.integralShuffleStep`: native integral shuffle with the positive interval, followed\n by the coefficient unitor and coordinate concatenation.\n* `TauCeti.iteratedIntegralShuffle`: the literal left-associated iteration starting at a point.\n* `TauCeti.iteratedIntegralShuffle_eq_orderedChain`: its equality, in every degree, with\n the positive permutation sum on the universal coordinate cube.\n-/\n\npublic section\nnoncomputable section\nopen CategoryTheory Limits MonoidalCategory CartesianMonoidalCategory HomologicalComplex Simplicial\nopen Equiv Convexity Equiv.Perm\nnamespace TauCeti\nopen SingularCube\n\n/-- The horizontal staircase vertices are the vertices after the native degeneracy. -/\nprivate lemma staircaseVertex_prismPermutation_castSucc {n : \u2115} (r : Fin (n + 1)) (\u03c0 : Perm (Fin n))\n (k : Fin (n + 2)) (j : Fin n) :\n staircaseVertex ((snocFin r \u03c0.symm).symm) k j.castSucc = staircaseVertex \u03c0 (r.predAbove k) j\n := by\n simp only [staircaseVertex_apply, Equiv.symm_symm, snocFin_castSucc]\n simp only [Fin.succAbove, Fin.predAbove, Fin.lt_def, Fin.val_castSucc,\n apply_dite Fin.val, Fin.val_pred, Fin.coe_castPred, dite_eq_ite,\n apply_ite Fin.val, Fin.val_succ]\n split_ifs <;> first | rfl | omega\n\n/-- The vertical staircase switches after step `r`. -/\nprivate lemma staircaseVertex_prismPermutation_last {n : \u2115} (r : Fin (n + 1)) (\u03c0 : Perm (Fin n))\n (k : Fin (n + 2)) :\n staircaseVertex ((snocFin r \u03c0.symm).symm) k (Fin.last n) = if (r : \u2115) < (k : \u2115) then 1 else 0\n := by\n simp [staircaseVertex_apply]\n\n/-- Horizontal coordinates of the actual staircase are the native degenerate simplex. -/\nprivate lemma staircaseSimplex_prism_castSucc {n : \u2115} (r : Fin (n + 1)) (\u03c0 : Perm (Fin n))\n (w : StdSimplex \u211d (Fin (n + 2))) (j : Fin n) :\n staircaseSimplex ((snocFin r \u03c0.symm).symm) w j.castSucc = staircaseSimplex \u03c0 (w.map\n r.predAbove) j := by\n let a : ConvexSpace.AffineMap \u211d (StdSimplex \u211d (Fin (n + 2))) \u211d :=\n \u27e8fun w \u21a6 affineStaircaseSimplex ((snocFin r \u03c0.symm).symm) w j.castSucc,\n (affineStaircaseSimplex ((snocFin r \u03c0.symm).symm)).isAffineMap.eval _\u27e9\n let b : ConvexSpace.AffineMap \u211d (StdSimplex \u211d (Fin (n + 2))) \u211d :=\n \u27e8fun w \u21a6 affineStaircaseSimplex \u03c0 (w.map r.predAbove) j, by\n simpa only [ConvexSpace.AffineMap.comp_apply, StdSimplex.coe_affineMap,\n Function.comp_def] using\n ((affineStaircaseSimplex \u03c0).comp\n (StdSimplex.affineMap r.predAbove)).isAffineMap.eval j\u27e9\n have ha (w) : a w = affineStaircaseSimplex ((snocFin r \u03c0.symm).symm) w j.castSucc := by\n rfl\n have hb (w) : b w = affineStaircaseSimplex \u03c0 (w.map r.predAbove) j := by\n rfl\n have h : a = b := by\n apply StdSimplex.affineMap_ext\n intro k\n rw [ha, hb, StdSimplex.map_single, affineStaircaseSimplex_single,\n affineStaircaseSimplex_single]\n exact staircaseVertex_prismPermutation_castSucc r \u03c0 k j\n apply Subtype.ext\n simp only [staircaseSimplex_coe_apply]\n simpa only [ha, hb] using DFunLike.congr_fun h w\n/-- The vertical coordinate is the native affine simplex classified by the prism step. -/\nprivate lemma staircaseSimplex_prism_last {n : \u2115} (r : Fin (n + 1)) (\u03c0 : Perm (Fin n))\n (w : StdSimplex \u211d (Fin (n + 2))) :\n staircaseSimplex ((snocFin r \u03c0.symm).symm) w (Fin.last n) =\n StdSimplex.homeomorphI (w.map (SSet.stdSimplex.objEquiv\n (SSet.stdSimplex.objMk\u2081.{0} r.succ.castSucc))) := by\n let f : Fin (n + 2) \u2192 Fin 2 := SSet.stdSimplex.objEquiv\n (SSet.stdSimplex.objMk\u2081.{0} r.succ.castSucc)\n let a : ConvexSpace.AffineMap \u211d (StdSimplex \u211d (Fin (n + 2))) \u211d :=\n \u27e8fun w \u21a6 affineStaircaseSimplex ((snocFin r \u03c0.symm).symm) w (Fin.last n),\n (affineStaircaseSimplex ((snocFin r \u03c0.symm).symm)).isAffineMap.eval _\u27e9\n let b : ConvexSpace.AffineMap \u211d (StdSimplex \u211d (Fin (n + 2))) \u211d :=\n \u27e8fun w \u21a6 (w.map f).weights 1,\n Finsupp.isAffineMap_eval.comp ((StdSimplex.isAffineMap_weights \u211d (Fin 2)).comp\n (StdSimplex.affineMap f).isAffineMap)\u27e9\n have h : a = b := by\n apply StdSimplex.affineMap_ext\n intro k\n simp only [a, b, ConvexSpace.AffineMap.coe_mk,\n affineStaircaseSimplex_single, staircaseVertex_prismPermutation_last, StdSimplex.map_single,\n StdSimplex.weights_single, Finsupp.single_apply]\n -- The two local affine coordinates have reduced to weights of their vertex values;\n -- the remaining reduction identifies the real `0` and `1` literals in those weights.\n change (if (r : \u2115) < (k : \u2115) then (1 : \u211d) else 0) = if f k = 1 then 1 else 0\n have hf : f k = if (r : \u2115) < (k : \u2115) then 1 else 0 := by\n dsimp only [f]\n refine (SSet.stdSimplex.objMk\u2081_apply.{0} _ _).trans ?_\n simp only [Fin.lt_def, Fin.val_castSucc, Fin.val_succ]\n split_ifs <;> first | rfl | omega\n rw [hf]\n by_cases hk : (r : \u2115) < (k : \u2115) <;> simp [hk]\n apply Subtype.ext\n rw [StdSimplex.homeomorphI_apply_coe]\n rw [staircaseSimplex_coe_apply]\n exact DFunLike.congr_fun h w\n\n/-- Summing the prism insertion signs is exactly the signed sum over all larger orderings. -/\nprivate lemma sum_prismPermutation {A : Type*} [AddCommGroup A] (n : \u2115)\n (F : Perm (Fin (n + 1)) \u2192 A) :\n (\u2211 \u03c0 : Perm (Fin n), (\u03c0.sign : \u2124) \u2022\n \u2211 r : Fin (n + 1), ((-1 : \u2124) ^ (n + (r : \u2115))) \u2022 F ((snocFin r \u03c0.symm).symm)) =\n \u2211 \u03c1 : Perm (Fin (n + 1)), (\u03c1.sign : \u2124) \u2022 F \u03c1 := by\n have hc (r : Fin (n + 1)) (\u03c0 : Perm (Fin n)) :\n (\u03c0.sign : \u2124) * (-1 : \u2124) ^ (n + (r : \u2115)) = Perm.sign (snocFin r \u03c0.symm).symm := by\n simp [sign_snocFin, add_comm, mul_comm]\n simp only [Finset.smul_sum, smul_smul, hc]\n rw [Finset.sum_comm]\n conv_rhs => rw [\u2190 Equiv.sum_comp (insertLastEquiv n)]\n simp [Fintype.sum_prod_type, insertLastEquiv_apply, Perm.inv_def]\n\n/-- Append the interval factor as the last coordinate of the original coordinate cube. -/\ndef snocMap (n : \u2115) :\n (TopCat.of (Fin n \u2192 unitInterval)) \u2297 TopCat.of unitInterval \u27f6\n TopCat.of (Fin (n + 1) \u2192 unitInterval) :=\n TopCat.ofHom \u27e8fun z \u21a6 Fin.snoc z.1 z.2, by\n apply continuous_pi\n intro i\n refine Fin.lastCases ?_ (fun j \u21a6 ?_) i\n \u00b7 simpa only [Fin.snoc_last] using continuous_snd\n \u00b7 simpa only [Fin.snoc_castSucc, Function.comp_def] using\n (continuous_apply j).comp continuous_fst\u27e9\n\n/-- Evaluation of coordinate concatenation. -/\n@[simp]\nlemma snocMap_apply (n : \u2115) (z : (Fin n \u2192 unitInterval) \u00d7 unitInterval) :\n snocMap n z = Fin.snoc z.1 z.2 := by\n unfold snocMap\n rfl\n\n/-- Each native prism simplex becomes the stated staircase simplex in the cube. -/\nprivate lemma classified_prism {n : \u2115} (r : Fin (n + 1)) (\u03c0 : Perm (Fin n)) :\n ((SSet.yonedaEquiv.symm\n (((TopCat.of (Fin n \u2192 unitInterval)).toSSetObjEquiv _).symm (staircaseSimplex \u03c0)) \u2297\u2098\n SSet.yonedaEquiv.symm (TauCeti.TopCat.simplex\u2081 (X := TopCat.of unitInterval)\n (ContinuousMap.id unitInterval))) \u226b\n Functor.LaxMonoidal.\u03bc TopCat.toSSet _ _ \u226b TopCat.toSSet.map (snocMap n)).app _\n (SSet.prodStdSimplex\u2081.nonDegenerateEquiv r).val =\n ((TopCat.of (Fin (n + 1) \u2192 unitInterval)).toSSetObjEquiv _).symm\n (staircaseSimplex ((snocFin r \u03c0.symm).symm)) := by\n -- The native enumeration has precisely the degeneracy and interval projections.\n have he : (SSet.prodStdSimplex\u2081.nonDegenerateEquiv r).val =\n ((SSet.stdSimplex.objEquiv.symm (SimplexCategory.\u03c3 r),\n SSet.stdSimplex.objMk\u2081 r.succ.castSucc) : ((\u0394[n] : SSet.{0}) \u2297 \u0394[1]) _\u298bn + 1\u298c) := by\n apply Prod.ext\n \u00b7 exact SSet.prodStdSimplex\u2081.nonDegenerateEquiv_fst r\n \u00b7 exact SSet.prodStdSimplex\u2081.nonDegenerateEquiv_snd r\n rw [he]\n apply ((TopCat.of (Fin (n + 1) \u2192 unitInterval)).toSSetObjEquiv _).injective\n apply ContinuousMap.ext\n intro w\n -- Pointwise evaluation of the native product functor keeps its product instance intact.\n change snocMap n (((TopCat.of (Fin n \u2192 unitInterval)) \u2297 TopCat.of unitInterval).toSSetObjEquiv _\n ((Functor.LaxMonoidal.\u03bc TopCat.toSSet _ _).app _\n ((SSet.yonedaEquiv.symm\n (((TopCat.of (Fin n \u2192 unitInterval)).toSSetObjEquiv _).symm (staircaseSimplex \u03c0))).app _\n (SSet.stdSimplex.objEquiv.symm (SimplexCategory.\u03c3 r)),\n (SSet.yonedaEquiv.symm (TauCeti.TopCat.simplex\u2081 (X := TopCat.of unitInterval)\n (ContinuousMap.id unitInterval))).app _\n (SSet.stdSimplex.objMk\u2081 r.succ.castSucc))) w) = _\n simp only [Monoidal.tensorObj_obj]\n rw [TopCat.toSSetObjEquiv_\u03bc_apply]\n rw [TopCat.toSSetObjEquiv_yonedaEquiv_symm_app, TopCat.toSSetObjEquiv_yonedaEquiv_symm_app,\n Equiv.apply_symm_apply,\n TauCeti.TopCat.toSSetObjEquiv_simplex\u2081]\n simp only [ContinuousMap.comp_apply, ContinuousMap.id_apply, Equiv.apply_symm_apply]\n -- The native degeneracy has staircaseVertex map `r.predAbove`, and `snocMap` concatenates\n -- coordinates.\n change Fin.snoc (staircaseSimplex \u03c0 (w.map r.predAbove))\n (StdSimplex.homeomorphI (w.map (SSet.stdSimplex.objEquiv\n (SSet.stdSimplex.objMk\u2081 r.succ.castSucc)))) = staircaseSimplex ((snocFin r \u03c0.symm).symm) w\n funext i\n refine Fin.lastCases ?_ (fun j \u21a6 ?_) i\n \u00b7 simp only [Fin.snoc_last]\n exact (staircaseSimplex_prism_last r \u03c0 w).symm\n \u00b7 simp only [Fin.snoc_castSucc]\n exact (staircaseSimplex_prism_castSucc r \u03c0 w j).symm\n\n\n/-- One actual integral shuffle with the positive interval, with the coefficient tensor\nidentified with `\u2124` by its native unitor, followed by coordinate concatenation. -/\ndef integralShuffleStep (n : \u2115) :\n (((TopCat.toSSet.obj (TopCat.of (Fin n \u2192 unitInterval))).chainComplex\n (ModuleCat.of \u2124 \u2124)).X n) \u2192+\n (((TopCat.toSSet.obj (TopCat.of (Fin (n + 1) \u2192 unitInterval))).chainComplex\n (ModuleCat.of \u2124 \u2124)).X (n + 1)) where\n toFun a := ((SSet.chainComplexMap (TopCat.toSSet.map (snocMap n))\n (ModuleCat.of \u2124 \u2124)).f (n + 1)).hom\n (((((SSet.chainComplexFunctor (ModuleCat.{0} \u2124)).map\n (\u03bb_ (\ud835\udfd9_ (ModuleCat.{0} \u2124))).hom).app\n (TopCat.toSSet.obj ((TopCat.of (Fin n \u2192 unitInterval)) \u2297 TopCat.of unitInterval))).f\n (n + 1)).hom\n (((TopCat.shuffle _ _ (\ud835\udfd9_ (ModuleCat.{0} \u2124)) (\ud835\udfd9_ (ModuleCat.{0} \u2124))).f\n (n + 1)).hom\n ((\u03b9TensorObj ((TopCat.toSSet.obj (TopCat.of (Fin n \u2192 unitInterval))).chainComplex\n (ModuleCat.of \u2124 \u2124)) ((TopCat.toSSet.obj (TopCat.of unitInterval)).chainComplex\n (ModuleCat.of \u2124 \u2124)) n 1 (n + 1) rfl).hom\n (a \u2297\u209c[\u2124] ((TopCat.toSSet.obj (TopCat.of unitInterval)).\u03b9ChainComplex\n (R := ModuleCat.of \u2124 \u2124) (TauCeti.TopCat.simplex\u2081 (X := TopCat.of unitInterval)\n (ContinuousMap.id unitInterval))).hom 1))))\n map_zero' := by\n simp only [TensorProduct.zero_tmul, map_zero]\n map_add' a b := by\n simp only [TensorProduct.add_tmul, map_add]\n\n/-- The native binary shuffle formula, with its actual prism simplices. -/\nprivate lemma shuffle_prism (n : \u2115) (\u03c0 : Perm (Fin n)) :\n ((TopCat.toSSet.obj (TopCat.of (Fin n \u2192 unitInterval))).\u03b9ChainComplex\n (((TopCat.of (Fin n \u2192 unitInterval)).toSSetObjEquiv _).symm (staircaseSimplex \u03c0)) \u2297\u2098\n (TopCat.toSSet.obj (TopCat.of unitInterval)).\u03b9ChainComplex\n (TauCeti.TopCat.simplex\u2081 (X := TopCat.of unitInterval)\n (ContinuousMap.id unitInterval))) \u226b\n \u03b9TensorObj _ _ n 1 (n + 1) rfl \u226b\n (TopCat.shuffle _ _ (\ud835\udfd9_ (ModuleCat.{0} \u2124)) (\ud835\udfd9_ (ModuleCat.{0} \u2124))).f (n + 1) =\n \u2211 r : Fin (n + 1), ((-1 : \u2124) ^ (n + (r : \u2115))) \u2022\n (TopCat.toSSet.obj\n ((TopCat.of (Fin n \u2192 unitInterval)) \u2297 TopCat.of unitInterval)).\u03b9ChainComplex\n (((SSet.yonedaEquiv.symm\n (((TopCat.of (Fin n \u2192 unitInterval)).toSSetObjEquiv _).symm (staircaseSimplex \u03c0)) \u2297\u2098\n SSet.yonedaEquiv.symm (TauCeti.TopCat.simplex\u2081 (X := TopCat.of unitInterval)\n (ContinuousMap.id unitInterval))) \u226b\n Functor.LaxMonoidal.\u03bc TopCat.toSSet _ _).app _\n (SSet.prodStdSimplex\u2081.nonDegenerateEquiv r).val) := by\n rw [TopCat.\u03b9ChainComplex_tensorHom_\u03b9ChainComplex_shuffle_f,\n SSet.shuffleChain_right_interval]\n simp only [Preadditive.sum_comp, Preadditive.zsmul_comp]\n refine Finset.sum_congr rfl fun r _ \u21a6 ?_\n exact congrArg (fun f \u21a6 ((-1 : \u2124) ^ (n + (r : \u2115))) \u2022 f)\n (SSet.\u03b9_chainComplexMap_f _ _ _ _ _)\n\n/-- Evaluate one literal integral shuffle step on a native singular generator, including the\ncoefficient unitor and coordinate concatenation. -/\nlemma integralShuffleStep_apply_\u03b9 (n : \u2115)\n (x : (TopCat.toSSet.obj (TopCat.of (Fin n \u2192 unitInterval))) _\u298bn\u298c) : integralShuffleStep n\n (((TopCat.toSSet.obj (TopCat.of (Fin n \u2192 unitInterval))).\u03b9ChainComplex\n (R := ModuleCat.of \u2124 \u2124)\n x).hom 1) =\n ((\u03bb_ (\ud835\udfd9_ (ModuleCat.{0} \u2124))).inv \u226b\n ((TopCat.toSSet.obj _).\u03b9ChainComplex\n x \u2297\u2098\n (TopCat.toSSet.obj (TopCat.of unitInterval)).\u03b9ChainComplex\n (TauCeti.TopCat.simplex\u2081 (X := TopCat.of unitInterval)\n (ContinuousMap.id unitInterval))) \u226b\n \u03b9TensorObj _ _ n 1 (n + 1) rfl \u226b\n (TopCat.shuffle _ _ (\ud835\udfd9_ (ModuleCat.{0} \u2124)) (\ud835\udfd9_ (ModuleCat.{0} \u2124))).f (n + 1) \u226b\n ((((SSet.chainComplexFunctor (ModuleCat.{0} \u2124)).map\n (\u03bb_ (\ud835\udfd9_ (ModuleCat.{0} \u2124))).hom).app\n (TopCat.toSSet.obj ((TopCat.of (Fin n \u2192 unitInterval)) \u2297 TopCat.of unitInterval))).f\n (n + 1)) \u226b\n (SSet.chainComplexMap (TopCat.toSSet.map (snocMap n))\n (ModuleCat.of \u2124 \u2124)).f (n + 1)).hom 1 := by\n -- The coefficient unitor inverse sends `1` to `1 \u2297 1`, and tensor maps act factorwise.\n rfl\n\n/-- One integral shuffle inserts the interval at each possible ordered step. -/\nprivate lemma integralShuffleStep_simplex (n : \u2115) (\u03c0 : Perm (Fin n)) :\n integralShuffleStep n\n (((TopCat.toSSet.obj (TopCat.of (Fin n \u2192 unitInterval))).\u03b9ChainComplex\n (R := ModuleCat.of \u2124 \u2124)\n (((TopCat.of (Fin n \u2192 unitInterval)).toSSetObjEquiv _).symm (staircaseSimplex \u03c0))).hom 1) =\n \u2211 r : Fin (n + 1), ((-1 : \u2124) ^ (n + (r : \u2115))) \u2022\n ((TopCat.toSSet.obj (TopCat.of (Fin (n + 1) \u2192 unitInterval))).\u03b9ChainComplex\n (R := ModuleCat.of \u2124 \u2124)\n (((TopCat.of (Fin (n + 1) \u2192 unitInterval)).toSSetObjEquiv _).symm\n (staircaseSimplex ((snocFin r \u03c0.symm).symm)))).hom 1 := by\n let A := (((SSet.chainComplexFunctor (ModuleCat.{0} \u2124)).map\n (\u03bb_ (\ud835\udfd9_ (ModuleCat.{0} \u2124))).hom).app\n (TopCat.toSSet.obj ((TopCat.of (Fin n \u2192 unitInterval)) \u2297 TopCat.of unitInterval)))\n let B := SSet.chainComplexMap (TopCat.toSSet.map (snocMap n)) (ModuleCat.of \u2124 \u2124)\n let f := (SSet.yonedaEquiv.symm\n (((TopCat.of (Fin n \u2192 unitInterval)).toSSetObjEquiv _).symm (staircaseSimplex \u03c0)) \u2297\u2098\n SSet.yonedaEquiv.symm (TauCeti.TopCat.simplex\u2081 (X := TopCat.of unitInterval)\n (ContinuousMap.id unitInterval))) \u226b\n Functor.LaxMonoidal.\u03bc TopCat.toSSet _ _\n let z (r : Fin (n + 1)) : ((\u0394[n] : SSet.{0}) \u2297 \u0394[1]) _\u298bn + 1\u298c :=\n (SSet.prodStdSimplex\u2081.nonDegenerateEquiv r).val\n have hz (r : Fin (n + 1)) : (TopCat.toSSet.map (snocMap n)).app _ (f.app _ (z r)) =\n ((TopCat.of (Fin (n + 1) \u2192 unitInterval)).toSSetObjEquiv _).symm\n (staircaseSimplex ((snocFin r \u03c0.symm).symm)) := classified_prism r \u03c0\n have ht (r : Fin (n + 1)) :\n (TopCat.toSSet.obj _).\u03b9ChainComplex (f.app _ (z r)) \u226b A.f (n + 1) \u226b B.f (n + 1) =\n (\u03bb_ (\ud835\udfd9_ (ModuleCat.{0} \u2124))).hom \u226b\n (TopCat.toSSet.obj _).\u03b9ChainComplex\n (((TopCat.of (Fin (n + 1) \u2192 unitInterval)).toSSetObjEquiv _).symm\n (staircaseSimplex ((snocFin r \u03c0.symm).symm))) := by\n calc\n _ = (\u03bb_ (\ud835\udfd9_ (ModuleCat.{0} \u2124))).hom \u226b\n (TopCat.toSSet.obj _).\u03b9ChainComplex (f.app _ (z r)) \u226b B.f (n + 1) := by\n exact SSet.\u03b9ChainComplex_chainComplexFunctor_map_app_f_assoc _ _ _\n _ = _ := by\n exact congrArg ((\u03bb_ (\ud835\udfd9_ (ModuleCat.{0} \u2124))).hom \u226b \u00b7)\n ((SSet.\u03b9_chainComplexMap_f _ _ _ _ _).trans (congrArg _ (hz r)))\n have h := congrArg (fun g \u21a6 g \u226b A.f (n + 1) \u226b B.f (n + 1)) (shuffle_prism n \u03c0)\n simp only [Preadditive.sum_comp, Preadditive.zsmul_comp] at h\n have hfold := h.trans (Finset.sum_congr rfl fun r _ \u21a6\n congrArg (fun g \u21a6 ((-1 : \u2124) ^ (n + (r : \u2115))) \u2022 g) (ht r))\n have hunit := congrArg ((\u03bb_ (\ud835\udfd9_ (ModuleCat.{0} \u2124))).inv \u226b \u00b7) hfold\n simp only [Preadditive.comp_sum, Preadditive.comp_zsmul, \u2190 Category.assoc,\n Iso.inv_hom_id, Category.id_comp] at hunit\n have he := congrArg (fun g \u21a6 g.hom (1 : \u2124)) hunit\n rw [integralShuffleStep_apply_\u03b9]\n simpa only [ModuleCat.hom_sum, ModuleCat.hom_zsmul,\n \u2190 LinearMap.evalAddMonoidHom_apply, map_sum, map_zsmul, Category.assoc] using he\n\n", "statement": "/-- A shuffle step takes the actual integral ordered `n`-cube to the ordered `(n+1)`-cube. -/\nlemma integralShuffleStep_orderedChain (n : \u2115) :\n integralShuffleStep n\n ((orderedChain (X := TopCat.of (Fin n \u2192 unitInterval)) (ContinuousMap.id (Fin n \u2192\n unitInterval)) (ModuleCat.of \u2124 \u2124)).hom 1) =\n (orderedChain (X := TopCat.of (Fin (n + 1) \u2192 unitInterval)) (ContinuousMap.id (Fin (n + 1) \u2192\n unitInterval)) (ModuleCat.of \u2124 \u2124)).hom 1 ", "proof": " by\n simp only [orderedChain_eq_sum, ContinuousMap.id_comp, Units.smul_def,\n ModuleCat.hom_sum, ModuleCat.hom_zsmul,\n \u2190 LinearMap.evalAddMonoidHom_apply, map_sum, map_zsmul]\n calc\n _ = \u2211 \u03c0 : Perm (Fin n), (\u03c0.sign : \u2124) \u2022\n \u2211 r : Fin (n + 1), ((-1 : \u2124) ^ (n + (r : \u2115))) \u2022\n ((TopCat.toSSet.obj (TopCat.of (Fin (n + 1) \u2192 unitInterval))).\u03b9ChainComplex\n (R := ModuleCat.of \u2124 \u2124)\n (((TopCat.of (Fin (n + 1) \u2192 unitInterval)).toSSetObjEquiv _).symm\n (staircaseSimplex ((snocFin r \u03c0.symm).symm)))).hom 1 := by\n refine Finset.sum_congr rfl fun \u03c0 _ \u21a6 ?_\n exact congrArg (fun a \u21a6 (\u03c0.sign : \u2124) \u2022 a) (integralShuffleStep_simplex n \u03c0)\n _ = _ := sum_prismPermutation\n (A := \u2191(((TopCat.toSSet.obj (TopCat.of (Fin (n + 1) \u2192 unitInterval))).chainComplex\n (ModuleCat.of \u2124 \u2124)).X (n + 1))) n\n (fun \u03c1 \u21a6 ((TopCat.toSSet.obj (TopCat.of (Fin (n + 1) \u2192 unitInterval))).\u03b9ChainComplex\n (R := ModuleCat.of \u2124 \u2124)\n (((TopCat.of (Fin (n + 1) \u2192 unitInterval)).toSSetObjEquiv _).symm\n (staircaseSimplex \u03c1))).hom 1)", "proof_lines": 19, "proof_length": 955, "rev": "75c8aed5fea63047615a25a9763fd5b68a86e891", "heartbeats": 1864, "image": "lean-compression:tauceti-75c8aed5fe-a608030cfc", "split": "dev"} {"path": "TauCeti/Analysis/Complex/Conformal/Continuation/Etale.lean", "module": "TauCeti.Analysis.Complex.Conformal.Continuation.Etale", "theorem": "TauCeti.isAnalyticContinuationAlong_iff_continuousOn_germPoint", "prefix": "/-\nCopyright (c) 2026 The Tau Ceti contributors. All rights reserved.\nReleased under Apache 2.0 license as described in the file LICENSE.\nAuthors: The Tau Ceti contributors\n-/\nmodule\n\npublic import TauCeti.Analysis.Complex.Conformal.Continuation.Basic\npublic import TauCeti.Analysis.Complex.HolomorphicSheaf\n\n/-!\n# Analytic continuation as a lift to the \u00e9tal\u00e9 space of holomorphic germs\n\n`Conformal/Continuation/Basic.lean` defines `TauCeti.IsAnalyticContinuationAlong` \u2014 a family `f`\nof functions carrying, at each parameter time `t`, a germ at `\u03b3 t`, locally represented by a\nsingle holomorphic function \u2014 and its docstring records, without proof, that\n\n> reading the germs as points of the \u00e9tale space of holomorphic germs over `\u2102`, the condition says\n> precisely that `t \u21a6 (germ of f t at \u03b3 t)` is a continuous lift of `\u03b3`.\n\n`TauCeti/Analysis/Complex/HolomorphicSheaf.lean` builds that space. This file proves the sentence\n(`TauCeti.isAnalyticContinuationAlong_iff_continuousOn_germPoint`). The \u00e9tal\u00e9 projection is a\nseparated local homeomorphism, which is exactly what Mathlib's abstract monodromy theorem\n`IsLocalHomeomorph.monodromy_theorem` asks of a map, so that theorem applies verbatim to\nholomorphic germs.\n\n## The dictionary\n\nGiven that each `f t` is analytic at `\u03b3 t`, the two remaining clauses of a continuation \u2014 that the\npath is continuous and that nearby parameter times carry the same germ \u2014 and continuity of\n`t \u21a6 germPoint (f t) (\u03b3 t)` say the same thing, and the proof is a translation in both directions\nof the same fact about the \u00e9tal\u00e9 topology, namely that the germs of one section over one open set\nform a neighbourhood of each of them:\n\n* forwards, `f t =\u1da0[\ud835\udcdd (\u03b3 t)] f t\u2080` for `t` near `t\u2080` says the germ map agrees near `t\u2080` with\n `germPoint (f t\u2080) \u2218 \u03b3`, and the germ map of a *single* holomorphic function is continuous\n (`TauCeti.HolomorphicPresheaf.continuousOn_germPoint`), being the section of the \u00e9tal\u00e9 space\n that function sweeps out;\n* backwards, continuity puts the lifted point, for `t` near `t\u2080`, in the set of germs of one\n section representing `f t\u2080`, and reading that membership back through\n `TauCeti.HolomorphicPresheaf.germAt_eq_iff` \u2014 the identity of two germs is the eventual identity\n of two analytic functions \u2014 is the locality clause.\n\nThe base point of the lift is `\u03b3 t` by construction (`TauCeti.HolomorphicPresheaf.base_germPoint`),\nso no separate lifting condition has to be stated, and continuity of `\u03b3` itself need not be\nassumed: it is continuity of the lift composed with the continuous \u00e9tal\u00e9 projection. In the other\ndirection a continuous map into the \u00e9tal\u00e9 space is a continuation of its own representatives\n(`TauCeti.isAnalyticContinuationAlong_repFun`), so the two notions are interchangeable rather than\nmerely comparable.\n\n## Monodromy, and what this does not replace\n\n`Conformal/Monodromy.lean` proves the monodromy theorem for germ families directly, by a metric\nstability argument. Mathlib's abstract theorem now applies directly to the separated local\nhomeomorphism built here: it is stated about continuous lifts of the rows of a homotopy rel\nendpoints, not about germ families. It does\nnot replace `TauCeti.monodromy_theorem_of_free_homotopy`, whose homotopy is allowed to move the\nendpoints and whose conclusion is a continuation along the path the far endpoint sweeps out;\nMathlib's abstract theorem is rel endpoints and gives an equality of points, so the free-homotopy\nform remains the business of the metric engine in `Conformal/Monodromy.lean`. What is gained here\nis the interface: monodromy for holomorphic germs is now an instance of covering-space-style path\nlifting, the vocabulary in which deck groups and uniformization are phrased.\n\n## Main results\n\n* `TauCeti.isAnalyticContinuationAlong_iff_continuousOn_germPoint` \u2014 **a continuation along a path\n is exactly a continuous lift of that path to the \u00e9tal\u00e9 space of holomorphic germs**.\n* `TauCeti.isAnalyticContinuationAlong_repFun` \u2014 the converse reading: a continuous map into the\n \u00e9tal\u00e9 space continues the germs it carries along its own base path.\n\n## Generality\n\nThe germs are germs of maps `\u2102 \u2192 E` into a complex Banach space `E`, the generality of both\n`TauCeti.IsAnalyticContinuationAlong` and the sheaf built in\n`TauCeti/Analysis/Complex/HolomorphicSheaf.lean`. The two restrictions on `E` are the ones that\nfile records: `Type` rather than `Type*`, for a universe reason of Mathlib's \u00e9tal\u00e9 space, and\ncompleteness, which `AnalyticAt.exists_ball_analyticOnNhd` asks for. The parameter space `X` and\nthe parameter set `s` are arbitrary, as in\n`Conformal/Continuation/Basic.lean`: nothing below needs the parameter set to be an interval.\n\n## References\n\n* L. Ahlfors, *Complex Analysis*, Ch. 8 \u00a71.\n* O. Forster, *Lectures on Riemann Surfaces* (GTM 81), \u00a7\u00a76--7.\n-/\n\npublic section\n\nnamespace TauCeti\n\nopen CategoryTheory Metric Opposite Set TopologicalSpace Topology\n\nvariable {E : Type} [NormedAddCommGroup E] [NormedSpace \u2102 E] [CompleteSpace E]\n {X : Type*} [TopologicalSpace X] {f : X \u2192 \u2102 \u2192 E} {\u03b3 : X \u2192 \u2102} {s : Set X}\n\n/-! ### A continuation along a path is a continuous lift -/\n\n", "statement": "/-- **Analytic continuation along a path is a continuous lift to the \u00e9tal\u00e9 space of holomorphic\ngerms.** Assume each `f t` is analytic at `\u03b3 t`. Then `f` is an analytic continuation along `\u03b3`\nexactly when the germ it carries, read as a point of the \u00e9tal\u00e9 space of holomorphic germs, depends\ncontinuously on the parameter.\n\nNeither remaining clause of a continuation has to be assumed. The lifting condition is automatic,\nthe germ point of `f t` at `\u03b3 t` sitting over `\u03b3 t` by construction, and continuity of `\u03b3` is\ncontinuity of the lift composed with the \u00e9tal\u00e9 projection. So the content of the equivalence is\nthat the locality clause of a continuation \u2014 nearby parameter times carry the same germ \u2014 is\ncontinuity in the \u00e9tal\u00e9 topology. -/\ntheorem isAnalyticContinuationAlong_iff_continuousOn_germPoint\n (hf : \u2200 t \u2208 s, AnalyticAt \u2102 (f t) (\u03b3 t)) :\n IsAnalyticContinuationAlong f \u03b3 s \u2194\n ContinuousOn (fun t => HolomorphicPresheaf.germPoint (f t) (\u03b3 t)) s ", "proof": " by\n constructor\n \u00b7 intro hcont t\u2080 ht\u2080\n obtain \u27e8r, hr, hball\u27e9 := (hf t\u2080 ht\u2080).exists_ball_analyticOnNhd\n have hat : ContinuousAt (HolomorphicPresheaf.germPoint (f t\u2080)) (\u03b3 t\u2080) :=\n (HolomorphicPresheaf.continuousOn_germPoint\n (U := \u27e8ball (\u03b3 t\u2080) r, isOpen_ball\u27e9) hball).continuousAt\n (isOpen_ball.mem_nhds (mem_ball_self hr))\n refine (hat.comp_continuousWithinAt (hcont.continuousOn t\u2080 ht\u2080)).congr_of_eventuallyEq ?_ rfl\n filter_upwards [hcont.locallyEq t\u2080 ht\u2080] with t ht using HolomorphicPresheaf.germPoint_congr ht\n \u00b7 intro hcont\n have h\u03b3 : ContinuousOn \u03b3 s := by\n have hbase := (TopCat.Presheaf.EtaleSpace.continuous_base\n (holomorphicPresheaf E)).comp_continuousOn hcont\n simpa only [Function.comp_def, HolomorphicPresheaf.base_germPoint] using hbase\n refine \u27e8h\u03b3, hf, fun t ht => ?_\u27e9\n obtain \u27e8r, hr, hball\u27e9 := (hf t ht).exists_ball_analyticOnNhd\n set B : Opens (TopCat.of \u2102) := \u27e8ball (\u03b3 t) r, isOpen_ball\u27e9\n have hbB : \u03b3 t \u2208 B := mem_ball_self hr\n set sec := HolomorphicPresheaf.toSection B (f t) hball\n have hsec : HolomorphicPresheaf.sectionFun sec =\u1da0[\ud835\udcdd (\u03b3 t)] f t :=\n Filter.eventuallyEq_of_mem (isOpen_ball.mem_nhds hbB)\n (HolomorphicPresheaf.sectionFun_toSection hball)\n have hgerm : (holomorphicPresheaf E).germ B (\u03b3 t) hbB sec =\n (HolomorphicPresheaf.germPoint (f t) (\u03b3 t)).germ :=\n (HolomorphicPresheaf.germAt_eq_germ_of_eventuallyEq hbB sec hsec).symm\n have hnbhd := TopCat.Presheaf.EtaleSpace.eventually_nhds\n (HolomorphicPresheaf.germPoint (f t) (\u03b3 t)) hbB sec hgerm\n filter_upwards [(hcont t ht).eventually hnbhd, self_mem_nhdsWithin] with u hu hus\n obtain \u27e8hbu, hgu\u27e9 := hu\n have h\u2081 : HolomorphicPresheaf.germAt (f u) (\u03b3 u) =\n HolomorphicPresheaf.germAt (HolomorphicPresheaf.sectionFun sec) (\u03b3 u) :=\n hgu.trans (HolomorphicPresheaf.germAt_eq_germ hbu sec).symm\n have h\u2082 : f u =\u1da0[\ud835\udcdd (\u03b3 u)] HolomorphicPresheaf.sectionFun sec :=\n (HolomorphicPresheaf.germAt_eq_iff (hf u hus)\n (HolomorphicPresheaf.analyticOnNhd_sectionFun sec _ hbu)).mp h\u2081\n exact h\u2082.trans (Filter.eventuallyEq_of_mem (isOpen_ball.mem_nhds hbu)\n (HolomorphicPresheaf.sectionFun_toSection hball))", "proof_lines": 37, "proof_length": 2032, "rev": "75c8aed5fea63047615a25a9763fd5b68a86e891", "heartbeats": 1019, "image": "lean-compression:tauceti-75c8aed5fe-a608030cfc", "split": "dev"} {"path": "TauCeti/Analysis/Calculus/PlaneShear.lean", "module": "TauCeti.Analysis.Calculus.PlaneShear", "theorem": "TauCeti.measurePreserving_planeShear", "prefix": "/-\nCopyright (c) 2026 The Tau Ceti contributors. All rights reserved.\nReleased under Apache 2.0 license as described in the file LICENSE.\nAuthors: The Tau Ceti contributors\n-/\nmodule\n\npublic import Mathlib.Analysis.Calculus.ContDiff.Operations\npublic import Mathlib.Analysis.Calculus.Deriv.Comp\npublic import Mathlib.Analysis.Calculus.FDeriv.Mul\npublic import Mathlib.LinearAlgebra.Determinant\npublic import Mathlib.MeasureTheory.Measure.Haar.InnerProductSpace\nimport TauCeti.MeasureTheory.Measure.Haar.EuclideanSpace\n\n/-!\n# Shears of the plane\n\nFor a function `g : \u211d \u2192 \u211d` the **shear** `(x, y) \u21a6 (x, y + g x)` of the plane `\u211d\u00b2`\n(`TauCeti.planeShear`) has inverse the shear along `-g`, and shears compose by adding their\nfunctions (`TauCeti.planeShear_planeShear`). For continuous `g` it is a homeomorphism\n(`TauCeti.planeShearHomeomorph`), and for measurable `g` a measurable equivalence\n(`TauCeti.planeShearMeasurableEquiv`) that preserves Lebesgue measure\n(`TauCeti.measurePreserving_planeShear`). Where `g` is differentiable the derivative of the shear is\n`v \u21a6 v + g'(x) v\u2080 e\u2081` (`TauCeti.hasFDerivAt_planeShear`), with determinant `1`\n(`TauCeti.det_fderiv_planeShear`), and the chain rule reads\n`D(f \u2218 \u03c6)(p) v = Df(\u03c6 p) v + g'(x) v\u2080 Df(\u03c6 p) e\u2081` (`TauCeti.fderiv_comp_planeShear_apply`).\n\n## Main declarations\n\n* `TauCeti.planeShear g`: the shear `(x, y) \u21a6 (x, y + g x)`, with inverse `planeShear (-g)`.\n* `TauCeti.planeShearHomeomorph`, `TauCeti.planeShearMeasurableEquiv`: the shear as a homeomorphism\n and as a measurable equivalence.\n* `TauCeti.measurePreserving_planeShear`: the shear preserves Lebesgue measure.\n* `TauCeti.hasFDerivAt_planeShear`, `TauCeti.det_fderiv_planeShear`: its derivative, of determinant\n `1`.\n* `TauCeti.fderiv_comp_planeShear_apply`: the chain rule for precomposition with the shear.\n-/\n\npublic section\n\nnoncomputable section\n\nopen MeasureTheory\n\nnamespace TauCeti\n\n/-- The **shear** `(x, y) \u21a6 (x, y + g x)` of the plane along a function `g : \u211d \u2192 \u211d`. -/\ndef planeShear (g : \u211d \u2192 \u211d) (p : EuclideanSpace \u211d (Fin 2)) : EuclideanSpace \u211d (Fin 2) :=\n p + g (p 0) \u2022 EuclideanSpace.single 1 1\n\nvariable {g : \u211d \u2192 \u211d}\n\ntheorem planeShear_def (g : \u211d \u2192 \u211d) (p : EuclideanSpace \u211d (Fin 2)) :\n planeShear g p = p + g (p 0) \u2022 EuclideanSpace.single 1 1 :=\n (rfl)\n\n@[simp]\ntheorem planeShear_apply_zero (p : EuclideanSpace \u211d (Fin 2)) : planeShear g p 0 = p 0 := by\n simp [planeShear]\n\n@[simp]\ntheorem planeShear_apply_one (p : EuclideanSpace \u211d (Fin 2)) :\n planeShear g p 1 = p 1 + g (p 0) := by\n simp [planeShear]\n\n@[simp]\ntheorem planeShear_zero : planeShear 0 = id := by\n ext p : 1\n simp [planeShear]\n\n/-- Shears compose by adding their functions. -/\n@[simp]\ntheorem planeShear_planeShear (g\u2081 g\u2082 : \u211d \u2192 \u211d) (p : EuclideanSpace \u211d (Fin 2)) :\n planeShear g\u2081 (planeShear g\u2082 p) = planeShear (g\u2081 + g\u2082) p := by\n rw [planeShear_def g\u2081, planeShear_apply_zero, planeShear_def, planeShear_def, Pi.add_apply,\n add_smul]\n abel\n\ntheorem planeShear_neg_planeShear (p : EuclideanSpace \u211d (Fin 2)) :\n planeShear (-g) (planeShear g p) = p := by\n simp\n\ntheorem planeShear_planeShear_neg (p : EuclideanSpace \u211d (Fin 2)) :\n planeShear g (planeShear (-g) p) = p := by\n simp\n\n/-- The derivative of the shear: `D \u03c6(p) v = v + g'(p\u2080) v\u2080 e\u2081`. -/\ntheorem hasFDerivAt_planeShear {p : EuclideanSpace \u211d (Fin 2)} (hg : DifferentiableAt \u211d g (p 0)) :\n HasFDerivAt (planeShear g)\n (ContinuousLinearMap.id \u211d _ +\n (deriv g (p 0) \u2022 EuclideanSpace.proj (\ud835\udd5c := \u211d) (0 : Fin 2)).smulRight\n (EuclideanSpace.single 1 1)) p :=\n (hasFDerivAt_id p).add ((hg.hasDerivAt.comp_hasFDerivAt p\n (EuclideanSpace.proj (\ud835\udd5c := \u211d) (0 : Fin 2)).hasFDerivAt).smul_const _)\n\ntheorem fderiv_planeShear_apply {p : EuclideanSpace \u211d (Fin 2)} (hg : DifferentiableAt \u211d g (p 0))\n (v : EuclideanSpace \u211d (Fin 2)) :\n fderiv \u211d (planeShear g) p v = v + (deriv g (p 0) * v 0) \u2022 EuclideanSpace.single 1 1 := by\n simp [(hasFDerivAt_planeShear hg).fderiv]\n\n/-- **The Jacobian determinant of a shear is `1`.** -/\ntheorem det_fderiv_planeShear {p : EuclideanSpace \u211d (Fin 2)} (hg : DifferentiableAt \u211d g (p 0)) :\n (fderiv \u211d (planeShear g) p).det = 1 := by\n rw [ContinuousLinearMap.det,\n \u2190 LinearMap.det_toMatrix (EuclideanSpace.basisFun (Fin 2) \u211d).toBasis, Matrix.det_fin_two]\n simp [LinearMap.toMatrix_apply, fderiv_planeShear_apply hg]\n\n/-- **The chain rule for the shear**: `D(f \u2218 \u03c6)(p) v = Df(\u03c6 p) v + g'(p\u2080) v\u2080 Df(\u03c6 p) e\u2081`. -/\ntheorem fderiv_comp_planeShear_apply {F : Type*} [NormedAddCommGroup F] [NormedSpace \u211d F]\n {f : EuclideanSpace \u211d (Fin 2) \u2192 F} {p : EuclideanSpace \u211d (Fin 2)}\n (hf : DifferentiableAt \u211d f (planeShear g p)) (hg : DifferentiableAt \u211d g (p 0))\n (v : EuclideanSpace \u211d (Fin 2)) :\n fderiv \u211d (f \u2218 planeShear g) p v =\n fderiv \u211d f (planeShear g p) v +\n (deriv g (p 0) * v 0) \u2022 fderiv \u211d f (planeShear g p) (EuclideanSpace.single 1 1) := by\n rw [fderiv_comp p hf (hasFDerivAt_planeShear hg).differentiableAt,\n ContinuousLinearMap.comp_apply, fderiv_planeShear_apply hg, map_add, map_smul]\n\n@[fun_prop]\ntheorem continuous_planeShear (hg : Continuous g) : Continuous (planeShear g) := by\n unfold planeShear; fun_prop\n\n@[fun_prop]\ntheorem measurable_planeShear (hg : Measurable g) : Measurable (planeShear g) := by\n unfold planeShear; fun_prop\n\n@[fun_prop]\ntheorem contDiff_planeShear {n : WithTop \u2115\u221e} (hg : ContDiff \u211d n g) :\n ContDiff \u211d n (planeShear g) := by\n unfold planeShear\n exact contDiff_id.add ((hg.comp (EuclideanSpace.proj (\ud835\udd5c := \u211d) (0 : Fin 2)).contDiff).smul\n contDiff_const)\n\n/-- The shear along a continuous function, as a homeomorphism of the plane. -/\ndef planeShearHomeomorph (hg : Continuous g) :\n EuclideanSpace \u211d (Fin 2) \u2243\u209c EuclideanSpace \u211d (Fin 2) where\n toFun := planeShear g\n invFun := planeShear (-g)\n left_inv := planeShear_neg_planeShear\n right_inv := planeShear_planeShear_neg\n continuous_toFun := continuous_planeShear hg\n continuous_invFun := continuous_planeShear hg.neg\n\n@[simp]\ntheorem coe_planeShearHomeomorph (hg : Continuous g) : \u21d1(planeShearHomeomorph hg) = planeShear g :=\n (rfl)\n\n@[simp]\ntheorem coe_planeShearHomeomorph_symm (hg : Continuous g) :\n \u21d1(planeShearHomeomorph hg).symm = planeShear (-g) :=\n (rfl)\n\n/-- The shear along a measurable function, as a measurable equivalence of the plane. -/\ndef planeShearMeasurableEquiv (hg : Measurable g) :\n EuclideanSpace \u211d (Fin 2) \u2243\u1d50 EuclideanSpace \u211d (Fin 2) where\n toFun := planeShear g\n invFun := planeShear (-g)\n left_inv := planeShear_neg_planeShear\n right_inv := planeShear_planeShear_neg\n measurable_toFun := measurable_planeShear hg\n measurable_invFun := measurable_planeShear hg.neg\n\n@[simp]\ntheorem coe_planeShearMeasurableEquiv (hg : Measurable g) :\n \u21d1(planeShearMeasurableEquiv hg) = planeShear g :=\n (rfl)\n\n@[simp]\ntheorem coe_planeShearMeasurableEquiv_symm (hg : Measurable g) :\n \u21d1(planeShearMeasurableEquiv hg).symm = planeShear (-g) :=\n (rfl)\n\ntheorem measurableEmbedding_planeShear (hg : Measurable g) : MeasurableEmbedding (planeShear g) :=\n (planeShearMeasurableEquiv hg).measurableEmbedding\n\n", "statement": "/-- **The shear along a measurable function preserves Lebesgue measure.** -/\ntheorem measurePreserving_planeShear (hg : Measurable g) :\n MeasurePreserving (planeShear g) ", "proof": " by\n -- In coordinates `(x, y)` the shear is the skew product of the identity with the translations\n -- `y \u21a6 y + g x`.\n have h\u03c3 : MeasurePreserving (fun q : \u211d \u00d7 \u211d \u21a6 (q.1, q.2 + g q.1)) :=\n (MeasurePreserving.id volume).skew_product (g := fun x y \u21a6 y + g x)\n (measurable_snd.add (hg.comp measurable_fst))\n (ae_of_all _ fun x \u21a6 map_add_right_eq_self volume (g x))\n have h : planeShear g =\n euclideanPlaneEquivProd.symm \u2218 (fun q : \u211d \u00d7 \u211d \u21a6 (q.1, q.2 + g q.1)) \u2218 euclideanPlaneEquivProd\n := by\n ext p i\n fin_cases i <;> simp\n rw [h]\n exact measurePreserving_euclideanPlaneEquivProd.symm.comp\n (h\u03c3.comp measurePreserving_euclideanPlaneEquivProd)", "proof_lines": 14, "proof_length": 511, "rev": "75c8aed5fea63047615a25a9763fd5b68a86e891", "heartbeats": 1069, "image": "lean-compression:tauceti-75c8aed5fe-a608030cfc", "split": "dev"} {"path": "TauCeti/Combinatorics/Brauer/LoopCount.lean", "module": "TauCeti.Combinatorics.Brauer.LoopCount", "theorem": "TauCeti.onMiddleLoop_of_val_eq", "prefix": "/-\nCopyright (c) 2026 The Tau Ceti contributors. All rights reserved.\nReleased under Apache 2.0 license as described in the file LICENSE.\nAuthors: The Tau Ceti contributors\n-/\nmodule\n\npublic import Mathlib.Data.Set.Card\npublic import Mathlib.Data.Set.Finite.Lemmas\npublic import TauCeti.Combinatorics.Brauer.Compose\n\n/-!\n# The middle loops of a stack of two Brauer diagrams\n\nStacking the Brauer diagram `D\u2081` above `D\u2082` identifies the bottom boundary of `D\u2081` with the top\nboundary of `D\u2082`; the arcs of the two diagrams that meet that middle boundary form strands, and\n`TauCeti.composeDiagram` reads off the matching those strands induce on the outer boundary. Some\nof the arcs do not reach the outer boundary at all: they close up into **loops** in the middle.\nThe multiplication of the Brauer algebra on the diagram basis is the composite diagram weighted\nby `\u03b4` raised to the number of those loops, so that number is what this file counts.\n\nBoth arcs at a middle point `a` -- the arc of `D\u2081` at its bottom point `a`, and the arc of `D\u2082`\nat its top point `a` -- stay in the middle exactly when the first is a cap of `D\u2081` and the\nsecond a cup of `D\u2082` (`TauCeti.IsMiddleVertex`). Joining two middle points whenever an arc of\neither kind runs between them gives a graph on the middle boundary\n(`TauCeti.MiddleAdj`) in which every point carries at most one arc of each diagram, so a\nconnected component all of whose points carry both is a cycle: a closed middle loop. That is the\ndefinition used here: `TauCeti.OnMiddleLoop` says that every point reachable from `a` carries\nboth of its arcs, and `TauCeti.middleLoopCount` counts the loops by counting their least points.\n\nThe count is honest in both directions. It is positive as soon as a cap of `D\u2081` and a cup of\n`D\u2082` join the same pair of middle points (`TauCeti.middleLoopCount_pos_of_val_eq`), which is the\nloop that makes the Brauer generator `e` satisfy `e * e = \u03b4 \u2022 e`; and it vanishes when either\ndiagram is a permutation diagram (`TauCeti.middleLoopCount_permToBrauer_left` and\n`TauCeti.middleLoopCount_permToBrauer_right`), which is why the loop-weighted multiplication will\nrestrict along `TauCeti.permToBrauer` to the group algebra of the symmetric group. Loops are also\ndisjoint from the strands that `TauCeti.composeDiagram` reads: no strand starting at the outer\nboundary ever visits a point of a middle loop\n(`TauCeti.not_onMiddleLoop_of_reflTransGen_stackStep`), so the composite diagram and the loop\ncount are independent pieces of the same multiplication.\n\n## Main definitions\n\n* `TauCeti.MiddleAdj`: the middle graph of the stack of `D\u2081` above `D\u2082`.\n* `TauCeti.IsMiddleVertex`: both arcs at a middle point stay in the middle.\n* `TauCeti.OnMiddleLoop`: a middle point lies on a closed middle loop.\n* `TauCeti.middleLoopCount`: the number of closed middle loops, the exponent of `\u03b4` in the loop\n rule of the Brauer algebra.\n\n## Main results\n\n* `TauCeti.middleLoopCount_eq_zero_iff`: the count vanishes exactly when no middle point lies on\n a loop.\n* `TauCeti.middleLoopCount_eq_ncard_image`: the count is the number of connected components of\n the middle graph made of points on closed loops, read as classes of the quotient by that graph.\n* `TauCeti.middleLoopCount_pos_of_val_eq`: a cap of `D\u2081` and a cup of `D\u2082` on the same pair of\n middle points close up into a loop.\n* `TauCeti.middleLoopCount_permToBrauer_left`, `TauCeti.middleLoopCount_permToBrauer_right`:\n stacking with a permutation diagram creates no loop.\n* `TauCeti.two_mul_middleLoopCount_le`: a loop uses at least two of the `k` middle points, so\n there are at most `k / 2` loops.\n* `TauCeti.not_onMiddleLoop_of_reflTransGen_stackStep`: a strand of the stack never visits a\n point of a middle loop.\n* `TauCeti.exists_reflTransGen_stackStep_of_middleAdj`: a strand of the stack visits every\n middle point adjacent to one it visits.\n* `TauCeti.eq_or_composeDiagram_val_eq_inr_of_reflTransGen_stackStep`,\n `TauCeti.eq_or_composeDiagram_val_eq_inl_of_reflTransGen_stackStep`: a through strand at a\n middle point a strand of the stack visits leads back to its start or on to its far end.\n\n## References\n\n* [R. Brauer, *On algebras which are connected with the semisimple continuous groups*][brauer1937],\n Annals of Mathematics 38 (1937), 857-872.\n-/\n\npublic section\n\nnamespace TauCeti\n\nvariable {k : \u2115}\n\n/-- The middle point at which a boundary point of one of the two stacked diagrams sits, read off\nby forgetting which of the two boundaries it lies on. Applied to a middle state of\n`TauCeti.stackStep` it is the middle point the strand has reached. -/\ndef middlePoint : Fin k \u2295 Fin k \u2192 Fin k := Sum.elim id id\n\n/-- The middle point of a bottom boundary point is its index. -/\n@[simp]\ntheorem middlePoint_inl (a : Fin k) : middlePoint (Sum.inl a) = a := (rfl)\n\n/-- The middle point of a top boundary point is its index. -/\n@[simp]\ntheorem middlePoint_inr (a : Fin k) : middlePoint (Sum.inr a) = a := (rfl)\n\n/-- **The middle graph of a stack.** Two points `a` and `b` of the middle boundary of the stack\nof `D\u2081` above `D\u2082` are adjacent when a cap of `D\u2081` or a cup of `D\u2082` joins them: an arc that\nstays in the middle instead of running out to the outer boundary. -/\ndef MiddleAdj (D\u2081 D\u2082 : BrauerDiagram k) (a b : Fin k) : Prop :=\n D\u2081.val (Sum.inl a) = Sum.inl b \u2228 D\u2082.val (Sum.inr a) = Sum.inr b\n\n/-- Adjacency in the middle graph is a cap of `D\u2081` or a cup of `D\u2082` between the two points. -/\ntheorem middleAdj_def (D\u2081 D\u2082 : BrauerDiagram k) (a b : Fin k) :\n MiddleAdj D\u2081 D\u2082 a b \u2194\n D\u2081.val (Sum.inl a) = Sum.inl b \u2228 D\u2082.val (Sum.inr a) = Sum.inr b := (Iff.rfl)\n\n/-- **Both arcs at a middle point stay in the middle**: the arc of `D\u2081` at the bottom point `a`\nis a cap, and the arc of `D\u2082` at the top point `a` is a cup. These are exactly the middle points\nthat a strand cannot leave the stack through. -/\ndef IsMiddleVertex (D\u2081 D\u2082 : BrauerDiagram k) (a : Fin k) : Prop :=\n D\u2081.IsCap (Sum.inl a) \u2227 D\u2082.IsCup (Sum.inr a)\n\n/-- Keeping both arcs in the middle is being capped by `D\u2081` and cupped by `D\u2082`. -/\ntheorem isMiddleVertex_def (D\u2081 D\u2082 : BrauerDiagram k) (a : Fin k) :\n IsMiddleVertex D\u2081 D\u2082 a \u2194 D\u2081.IsCap (Sum.inl a) \u2227 D\u2082.IsCup (Sum.inr a) := (Iff.rfl)\n\n/-- **A middle point lies on a closed loop** of the stack of `D\u2081` above `D\u2082` when every middle\npoint reachable from it in the middle graph keeps both of its arcs in the middle. Each point of\nthe middle graph carries at most one arc of `D\u2081` and at most one arc of `D\u2082`, so such a\nconnected component is a cycle alternating between caps of `D\u2081` and cups of `D\u2082`: a loop that\ncloses up in the middle. -/\ndef OnMiddleLoop (D\u2081 D\u2082 : BrauerDiagram k) (a : Fin k) : Prop :=\n \u2200 b, Relation.ReflTransGen (MiddleAdj D\u2081 D\u2082) a b \u2192 IsMiddleVertex D\u2081 D\u2082 b\n\n/-- Lying on a closed middle loop is every reachable middle point keeping both of its arcs in\nthe middle. -/\ntheorem onMiddleLoop_def (D\u2081 D\u2082 : BrauerDiagram k) (a : Fin k) :\n OnMiddleLoop D\u2081 D\u2082 a \u2194\n \u2200 b, Relation.ReflTransGen (MiddleAdj D\u2081 D\u2082) a b \u2192 IsMiddleVertex D\u2081 D\u2082 b := (Iff.rfl)\n\n/-- `a` is the least middle point of the closed middle loop it lies on. Each loop has exactly\none such point, so these count the loops. -/\ndef IsMiddleLoopMin (D\u2081 D\u2082 : BrauerDiagram k) (a : Fin k) : Prop :=\n OnMiddleLoop D\u2081 D\u2082 a \u2227 \u2200 b, Relation.ReflTransGen (MiddleAdj D\u2081 D\u2082) a b \u2192 a \u2264 b\n\n/-- Being the least point of a loop is lying on a loop and being below every reachable point. -/\ntheorem isMiddleLoopMin_def (D\u2081 D\u2082 : BrauerDiagram k) (a : Fin k) :\n IsMiddleLoopMin D\u2081 D\u2082 a \u2194\n OnMiddleLoop D\u2081 D\u2082 a \u2227 \u2200 b, Relation.ReflTransGen (MiddleAdj D\u2081 D\u2082) a b \u2192 a \u2264 b := (Iff.rfl)\n\n/-- **The middle-loop count of a stack of two Brauer diagrams**: the number of loops that close\nup in the middle when `D\u2081` is stacked above `D\u2082`, counted by their least middle points. This is\nthe exponent of `\u03b4` in the loop rule that weights the multiplication of the Brauer algebra on\nthe diagram basis, `D\u2081 * D\u2082 = \u03b4 ^ middleLoopCount D\u2081 D\u2082 \u2022 composeDiagram D\u2081 D\u2082`. -/\nnoncomputable def middleLoopCount (D\u2081 D\u2082 : BrauerDiagram k) : \u2115 :=\n {a : Fin k | IsMiddleLoopMin D\u2081 D\u2082 a}.ncard\n\n/-- The middle-loop count is the number of least points of closed middle loops. -/\ntheorem middleLoopCount_def (D\u2081 D\u2082 : BrauerDiagram k) :\n middleLoopCount D\u2081 D\u2082 = {a : Fin k | IsMiddleLoopMin D\u2081 D\u2082 a}.ncard := (rfl)\n\nvariable {D\u2081 D\u2082 : BrauerDiagram k}\n\n/-! ### The middle graph -/\n\n/-- The middle graph is symmetric: an arc joining `a` to `b` joins `b` to `a`. -/\ntheorem MiddleAdj.symm {a b : Fin k} (h : MiddleAdj D\u2081 D\u2082 a b) : MiddleAdj D\u2081 D\u2082 b a := by\n rcases h with h | h\n \u00b7 exact Or.inl (D\u2081.apply_eq_of_apply_eq h)\n \u00b7 exact Or.inr (D\u2082.apply_eq_of_apply_eq h)\n\n/-- Reachability in the middle graph is symmetric. -/\ntheorem MiddleAdj.reflTransGen_symm {a b : Fin k}\n (h : Relation.ReflTransGen (MiddleAdj D\u2081 D\u2082) a b) :\n Relation.ReflTransGen (MiddleAdj D\u2081 D\u2082) b a :=\n Relation.ReflTransGen.mono (fun _ _ huv => MiddleAdj.symm huv) b a\n (Relation.ReflTransGen.swap b a h)\n\n/-- Two middle points have the same class in the quotient by the middle graph exactly when they\nare joined by a chain of its arcs, the middle graph being symmetric. -/\ntheorem mk_middleAdj_eq_mk_iff (D\u2081 D\u2082 : BrauerDiagram k) {a b : Fin k} :\n Quot.mk (MiddleAdj D\u2081 D\u2082) a = Quot.mk (MiddleAdj D\u2081 D\u2082) b \u2194\n Relation.ReflTransGen (MiddleAdj D\u2081 D\u2082) a b := by\n have : Std.Symm (MiddleAdj D\u2081 D\u2082) := \u27e8fun _ _ h => MiddleAdj.symm h\u27e9\n rw [Quot.eq, Relation.eqvGen_eq_reflTransGen]\n\n/-- A cap of `D\u2081` at the bottom middle point `a` lands at the middle point read off its far\nend, the point `BrauerDiagram.capMatching` pairs `a` with. -/\ntheorem BrauerDiagram.val_inl_eq_inl_middlePoint {D : BrauerDiagram k} {a : Fin k}\n (h : D.IsCap (Sum.inl a)) :\n D.val (Sum.inl a) = Sum.inl (middlePoint (D.val (Sum.inl a))) := by\n rw [\u2190 D.inl_capMatching \u27e8a, h\u27e9, middlePoint_inl]\n\n/-- A cup of `D\u2082` at the top middle point `a` lands at the middle point read off its far end,\nthe point `BrauerDiagram.cupMatching` pairs `a` with. -/\ntheorem BrauerDiagram.val_inr_eq_inr_middlePoint {D : BrauerDiagram k} {a : Fin k}\n (h : D.IsCup (Sum.inr a)) :\n D.val (Sum.inr a) = Sum.inr (middlePoint (D.val (Sum.inr a))) := by\n rw [\u2190 D.inr_cupMatching \u27e8a, h\u27e9, middlePoint_inr]\n\n/-! ### Points on a closed middle loop -/\n\n/-- A point of a closed middle loop keeps both of its arcs in the middle. -/\ntheorem OnMiddleLoop.isMiddleVertex {a : Fin k} (h : OnMiddleLoop D\u2081 D\u2082 a) :\n IsMiddleVertex D\u2081 D\u2082 a :=\n h a .refl\n\n/-- Lying on a closed middle loop is a property of the whole connected component. -/\ntheorem OnMiddleLoop.reflTransGen {a b : Fin k} (ha : OnMiddleLoop D\u2081 D\u2082 a)\n (hab : Relation.ReflTransGen (MiddleAdj D\u2081 D\u2082) a b) : OnMiddleLoop D\u2081 D\u2082 b :=\n fun c hc => ha c (hab.trans hc)\n\n/-- The cap of `D\u2081` at a point of a closed middle loop runs to another point of the same\nloop. -/\ntheorem OnMiddleLoop.capPartner {a : Fin k} (h : OnMiddleLoop D\u2081 D\u2082 a) :\n OnMiddleLoop D\u2081 D\u2082 (middlePoint (D\u2081.val (Sum.inl a))) :=\n h.reflTransGen (.single (Or.inl (BrauerDiagram.val_inl_eq_inl_middlePoint h.isMiddleVertex.1)))\n\n/-- The cup of `D\u2082` at a point of a closed middle loop runs to another point of the same\nloop. -/\ntheorem OnMiddleLoop.cupPartner {a : Fin k} (h : OnMiddleLoop D\u2081 D\u2082 a) :\n OnMiddleLoop D\u2081 D\u2082 (middlePoint (D\u2082.val (Sum.inr a))) :=\n h.reflTransGen (.single (Or.inr (BrauerDiagram.val_inr_eq_inr_middlePoint h.isMiddleVertex.2)))\n\n/-- **A loop has a least point.** Every point of a closed middle loop reaches the least point of\nthat loop. -/\ntheorem OnMiddleLoop.exists_isMiddleLoopMin {a : Fin k} (ha : OnMiddleLoop D\u2081 D\u2082 a) :\n \u2203 m, IsMiddleLoopMin D\u2081 D\u2082 m \u2227 Relation.ReflTransGen (MiddleAdj D\u2081 D\u2082) a m := by\n obtain \u27e8m, hm, hmin\u27e9 := Set.exists_min_image\n {b : Fin k | Relation.ReflTransGen (MiddleAdj D\u2081 D\u2082) a b} id (Set.toFinite _) \u27e8a, .refl\u27e9\n refine \u27e8m, \u27e8ha.reflTransGen hm, fun c hc => hmin c (hm.trans hc)\u27e9, hm\u27e9\n\n/-- **A loop has only one least point.** Two least points of closed middle loops joined in the\nmiddle graph are equal. -/\ntheorem IsMiddleLoopMin.eq_of_reflTransGen {p q : Fin k} (hp : IsMiddleLoopMin D\u2081 D\u2082 p)\n (hq : IsMiddleLoopMin D\u2081 D\u2082 q) (hpq : Relation.ReflTransGen (MiddleAdj D\u2081 D\u2082) p q) : p = q :=\n le_antisymm (hp.2 q hpq) (hq.2 p (MiddleAdj.reflTransGen_symm hpq))\n\n/-! ### The count -/\n\n/-- **No loop, no count.** The middle-loop count vanishes exactly when no middle point lies on a\nclosed loop. -/\ntheorem middleLoopCount_eq_zero_iff :\n middleLoopCount D\u2081 D\u2082 = 0 \u2194 \u2200 a, \u00acOnMiddleLoop D\u2081 D\u2082 a := by\n rw [middleLoopCount_def, Set.ncard_eq_zero (Set.toFinite _), Set.eq_empty_iff_forall_notMem]\n refine \u27e8fun h a ha => ?_, fun h a ha => h a ha.1\u27e9\n obtain \u27e8m, hm, -\u27e9 := ha.exists_isMiddleLoopMin\n exact h m hm\n\n/-- A middle point on a closed loop makes the count positive. -/\ntheorem middleLoopCount_pos_of_onMiddleLoop {a : Fin k} (ha : OnMiddleLoop D\u2081 D\u2082 a) :\n 0 < middleLoopCount D\u2081 D\u2082 :=\n Nat.pos_of_ne_zero fun h => (middleLoopCount_eq_zero_iff.mp h) a ha\n\n/-- **Loops are connected components.** The middle-loop count counts the closed middle loops as\nconnected components of the middle graph, that is as classes of the quotient by it, rather than\nby their least points. -/\ntheorem middleLoopCount_eq_ncard_image (D\u2081 D\u2082 : BrauerDiagram k) :\n middleLoopCount D\u2081 D\u2082 =\n (Quot.mk (MiddleAdj D\u2081 D\u2082) '' {a | OnMiddleLoop D\u2081 D\u2082 a}).ncard := by\n have hinj : Set.InjOn (Quot.mk (MiddleAdj D\u2081 D\u2082)) {a | IsMiddleLoopMin D\u2081 D\u2082 a} := by\n intro a ha b hb hab\n exact IsMiddleLoopMin.eq_of_reflTransGen ha hb ((mk_middleAdj_eq_mk_iff D\u2081 D\u2082).mp hab)\n rw [middleLoopCount_def, \u2190 hinj.ncard_image]\n congr 1\n ext S\n constructor\n \u00b7 rintro \u27e8a, ha, rfl\u27e9\n exact \u27e8a, ((isMiddleLoopMin_def D\u2081 D\u2082 a).mp ha).1, rfl\u27e9\n \u00b7 rintro \u27e8a, ha, rfl\u27e9\n obtain \u27e8m, hm, ham\u27e9 := (ha : OnMiddleLoop D\u2081 D\u2082 a).exists_isMiddleLoopMin\n exact \u27e8m, hm, ((mk_middleAdj_eq_mk_iff D\u2081 D\u2082).mpr ham).symm\u27e9\n\n", "statement": "/-- **A cap of `D\u2081` matching a cup of `D\u2082` closes up into a loop.** If the middle points `a` and\n`b` are joined both by a cap of `D\u2081` and by a cup of `D\u2082`, then `a` lies on a closed middle\nloop, namely the two-point loop `{a, b}`. -/\ntheorem onMiddleLoop_of_val_eq {a b : Fin k} (h\u2081 : D\u2081.val (Sum.inl a) = Sum.inl b)\n (h\u2082 : D\u2082.val (Sum.inr a) = Sum.inr b) : OnMiddleLoop D\u2081 D\u2082 a ", "proof": " by\n have h\u2081' : D\u2081.val (Sum.inl b) = Sum.inl a := D\u2081.apply_eq_of_apply_eq h\u2081\n have h\u2082' : D\u2082.val (Sum.inr b) = Sum.inr a := D\u2082.apply_eq_of_apply_eq h\u2082\n have hverta : IsMiddleVertex D\u2081 D\u2082 a := by\n constructor <;> simp [BrauerDiagram.isCap_def, BrauerDiagram.isCup_def, h\u2081, h\u2082]\n have hvertb : IsMiddleVertex D\u2081 D\u2082 b := by\n constructor <;> simp [BrauerDiagram.isCap_def, BrauerDiagram.isCup_def, h\u2081', h\u2082']\n intro c hc\n have key : c = a \u2228 c = b := by\n induction hc with\n | refl => exact Or.inl rfl\n | @tail u v _ huv ih =>\n rcases ih with rfl | rfl\n \u00b7 rcases huv with huv | huv\n \u00b7 exact Or.inr (Sum.inl_injective (h\u2081 \u25b8 huv).symm)\n \u00b7 exact Or.inr (Sum.inr_injective (h\u2082 \u25b8 huv).symm)\n \u00b7 rcases huv with huv | huv\n \u00b7 exact Or.inl (Sum.inl_injective (h\u2081' \u25b8 huv).symm)\n \u00b7 exact Or.inl (Sum.inr_injective (h\u2082' \u25b8 huv).symm)\n rcases key with rfl | rfl\n \u00b7 exact hverta\n \u00b7 exact hvertb", "proof_lines": 21, "proof_length": 848, "rev": "75c8aed5fea63047615a25a9763fd5b68a86e891", "heartbeats": 279, "image": "lean-compression:tauceti-75c8aed5fe-a608030cfc", "split": "dev"} {"path": "TauCeti/Geometry/RealAnalytic/Semianalytic/PartiallySemialgebraic/SharedRoots.lean", "module": "TauCeti.Geometry.RealAnalytic.Semianalytic.PartiallySemialgebraic.SharedRoots", "theorem": "TauCeti.partiallySemialgebraicAt_setOf_notMem_biUnion_roots_card_lt", "prefix": "/-\nCopyright (c) 2026 The Tau Ceti contributors. All rights reserved.\nReleased under Apache 2.0 license as described in the file LICENSE.\nAuthors: The Tau Ceti contributors\n-/\nmodule\n\npublic import TauCeti.Geometry.RealAnalytic.Semianalytic.PartiallySemialgebraic.Polynomial\npublic import TauCeti.Geometry.RealAlgebraic.Semialgebraic.SharedRoots\nimport Mathlib.FieldTheory.IsRealClosed.Real\n\n/-!\n# Shared root regions of analytic polynomial families\n\nThe ordered distinct-root loci and complementary sectors of a finite family of polynomials\nwith analytic coefficients are partially semialgebraic in the height variable. The description\nis uniform along the entire height fiber. Roots shared by several members, and repeated roots,\nare counted once. Nullified members contribute no roots, and the empty family is allowed.\n\nThe coefficient-space formulas come from\n`Finset.isSemialgebraic_setOf_mem_biUnion_roots_map_eval` and\n`Finset.isSemialgebraic_setOf_card_biUnion_roots_map_eval_lt`; analytic coefficient substitution\nthen gives the same formulas for analytic families. These descriptions make the sections and\nsectors of analytic-coefficient delineations semianalytic, even at their frontier points.\n\n## References\n\nS. Basu, R. Pollack, and M.-F. Roy, *Algorithms in Real Algebraic Geometry*, second edition,\nChapters 10 and 11 (uniform shared-root descriptions).\n-/\n\npublic section\n\nopen Filter Polynomial Set Topology\n\nnamespace TauCeti\n\nvariable {E \u03ba : Type*} [NormedAddCommGroup E] [NormedSpace \u211d E] [Fintype \u03ba]\n {F : \u03ba \u2192 E \u2192 \u211d[X]} {x\u2080 : E} {d : \u03ba \u2192 \u2115}\n\nprivate lemma isSemialgebraic_sharedRoots_ofFn (d : \u03ba \u2192 \u2115)\n (\u03a8 : Finset \u211d \u2192 \u211d \u2192 Prop)\n (h\u03a8 : \u2200 G : Finset (MvPolynomial ((\u03a3 k, Fin (d k + 1)) \u2295 Unit) \u211d)[X],\n IsSemialgebraic {v | \u03a8\n (G.biUnion (fun p \u21a6 (p.map (MvPolynomial.eval v)).roots.toFinset)) (v (.inr ()))}) :\n IsSemialgebraic {v : ((\u03a3 k, Fin (d k + 1)) \u2295 Unit) \u2192 \u211d | \u03a8\n (Finset.univ.biUnion (fun k \u21a6\n (Polynomial.ofFn (d k + 1) (fun j \u21a6 v (.inl \u27e8k, j\u27e9))).roots.toFinset))\n (v (.inr ()))} := by\n classical\n let P (k : \u03ba) := Polynomial.ofFn (d k + 1)\n (fun j : Fin (d k + 1) \u21a6\n (MvPolynomial.X (.inl \u27e8k, j\u27e9) : MvPolynomial ((\u03a3 k, Fin (d k + 1)) \u2295 Unit) \u211d))\n convert h\u03a8 (Finset.univ.image P) using 1\n ext v\n simp only [Finset.image_biUnion, P, Polynomial.ofFn_eq_sum_monomial,\n Polynomial.map_sum, Polynomial.map_monomial, MvPolynomial.eval_X, mem_ofPred_eq]\n\n/-- The locus of the `i`-th shared distinct root of a finite analytic polynomial family is\npartially semialgebraic. Root indexing starts at zero; zero polynomials contribute no roots. -/\ntheorem partiallySemialgebraicAt_setOf_mem_biUnion_roots_card_lt\n (hF : \u2200 k i, i \u2264 d k \u2192 AnalyticAt \u211d (fun x \u21a6 (F k x).coeff i) x\u2080)\n (hdeg : \u2200 k, \u2200\u1da0 x in \ud835\udcdd x\u2080, (F k x).natDegree \u2264 d k) (i : \u2115) :\n PartiallySemialgebraicAt {p : E \u00d7 (Unit \u2192 \u211d) |\n p.2 () \u2208 Finset.univ.biUnion (fun k \u21a6 (F k p.1).roots.toFinset) \u2227\n {r \u2208 Finset.univ.biUnion (fun k \u21a6 (F k p.1).roots.toFinset) | r < p.2 ()}.card = i} x\u2080 := by\n classical\n apply partiallySemialgebraicAt_polynomialFamily_condition\n (fun P t \u21a6 t \u2208 Finset.univ.biUnion (fun k \u21a6 (P k).roots.toFinset) \u2227\n {r \u2208 Finset.univ.biUnion (fun k \u21a6 (P k).roots.toFinset) | r < t}.card = i) ?_ hF hdeg\n apply isSemialgebraic_sharedRoots_ofFn d\n (fun Z t \u21a6 t \u2208 Z \u2227 (Z.filter (\u00b7 < t)).card = i)\n intro G\n simpa only [ofPred_and, MvPolynomial.eval_X] using\n (G.isSemialgebraic_setOf_mem_biUnion_roots_map_eval (MvPolynomial.X (.inr ()))).inter\n (G.isSemialgebraic_setOf_card_biUnion_roots_map_eval_lt (MvPolynomial.X (.inr ())) i)\n\n", "statement": "/-- The locus of the `i`-th shared-root sector is partially semialgebraic. It consists of\nnon-roots with exactly `i` shared distinct roots below them. If there are no roots, sector zero\nis the whole height fiber, including for an empty or entirely nullified family. -/\ntheorem partiallySemialgebraicAt_setOf_notMem_biUnion_roots_card_lt\n (hF : \u2200 k i, i \u2264 d k \u2192 AnalyticAt \u211d (fun x \u21a6 (F k x).coeff i) x\u2080)\n (hdeg : \u2200 k, \u2200\u1da0 x in \ud835\udcdd x\u2080, (F k x).natDegree \u2264 d k) (i : \u2115) :\n PartiallySemialgebraicAt {p : E \u00d7 (Unit \u2192 \u211d) |\n p.2 () \u2209 Finset.univ.biUnion (fun k \u21a6 (F k p.1).roots.toFinset) \u2227\n {r \u2208 Finset.univ.biUnion (fun k \u21a6 (F k p.1).roots.toFinset) | r < p.2 ()}.card = i} x\u2080 ", "proof": " by\n classical\n apply partiallySemialgebraicAt_polynomialFamily_condition\n (fun P t \u21a6 t \u2209 Finset.univ.biUnion (fun k \u21a6 (P k).roots.toFinset) \u2227\n {r \u2208 Finset.univ.biUnion (fun k \u21a6 (P k).roots.toFinset) | r < t}.card = i) ?_ hF hdeg\n apply isSemialgebraic_sharedRoots_ofFn d\n (fun Z t \u21a6 t \u2209 Z \u2227 (Z.filter (\u00b7 < t)).card = i)\n intro G\n simpa only [ofPred_and, compl_ofPred, MvPolynomial.eval_X] using\n (G.isSemialgebraic_setOf_mem_biUnion_roots_map_eval\n (MvPolynomial.X (.inr ()))).compl.inter\n (G.isSemialgebraic_setOf_card_biUnion_roots_map_eval_lt (MvPolynomial.X (.inr ())) i)", "proof_lines": 11, "proof_length": 564, "rev": "75c8aed5fea63047615a25a9763fd5b68a86e891", "heartbeats": 437, "image": "lean-compression:tauceti-75c8aed5fe-a608030cfc", "split": "dev"} {"path": "TauCeti/MeasureTheory/Integral/PosSemidef.lean", "module": "TauCeti.MeasureTheory.Integral.PosSemidef", "theorem": "TauCeti.posSemidef_integral", "prefix": "/-\nCopyright (c) 2026 The Tau Ceti contributors. All rights reserved.\nReleased under Apache 2.0 license as described in the file LICENSE.\nAuthors: The Tau Ceti contributors\n-/\nmodule\n\npublic import Mathlib.LinearAlgebra.Matrix.PosDef\npublic import Mathlib.MeasureTheory.Integral.Bochner.ContinuousLinearMap\n\n/-!\n# Integrals of positive-semidefinite matrices\n\nAn entrywise integral of an almost everywhere positive-semidefinite family of real or complex\nmatrices is positive semidefinite: its quadratic form is the integral of the pointwise quadratic\nforms. This is how positive semidefiniteness passes from a pointwise identity to a matrix of\nmoments, such as the connection matrices of a homomorphism density.\n\n## Main results\n\n* `TauCeti.posSemidef_integral` \u2014 the entrywise integral of an a.e. positive-semidefinite family of\n finite matrices over an `RCLike` field with integrable entries is positive semidefinite.\n-/\n\npublic section\n\nnamespace TauCeti\n\nopen Matrix MeasureTheory\nopen scoped ComplexOrder\n\n", "statement": "/-- The **entrywise integral of positive-semidefinite matrices** is positive semidefinite: if\n`M x` is positive semidefinite for almost every `x` and every entry of `M` is integrable, then the\nmatrix of entrywise integrals is positive semidefinite. -/\ntheorem posSemidef_integral {\u03b1 \u03b9 \ud835\udd5c : Type*} [MeasurableSpace \u03b1] {\u03bc : Measure \u03b1} [Finite \u03b9]\n [RCLike \ud835\udd5c] {M : \u03b1 \u2192 Matrix \u03b9 \u03b9 \ud835\udd5c} (hM : \u2200\u1d50 x \u2202\u03bc, (M x).PosSemidef)\n (hint : \u2200 i j, Integrable (fun x => M x i j) \u03bc) :\n (Matrix.of fun i j => \u222b x, M x i j \u2202\u03bc).PosSemidef ", "proof": " by\n have := Fintype.ofFinite \u03b9\n refine Matrix.PosSemidef.of_dotProduct_mulVec_nonneg ?_ fun c => ?_\n \u00b7 refine Matrix.IsHermitian.ext fun i j => ?_\n rw [Matrix.of_apply, Matrix.of_apply, RCLike.star_def, \u2190 integral_conj]\n exact integral_congr_ae (hM.mono fun x hx => hx.isHermitian.apply i j)\n \u00b7 have hquad : star c \u2b1d\u1d65 ((Matrix.of fun i j => \u222b x, M x i j \u2202\u03bc) *\u1d65 c) =\n \u222b x, star c \u2b1d\u1d65 (M x *\u1d65 c) \u2202\u03bc := by\n simp only [dotProduct, Matrix.mulVec, Matrix.of_apply]\n rw [integral_finsetSum _ fun i _ =>\n (integrable_finsetSum _ fun j _ => (hint i j).mul_const (c j)).const_mul _]\n refine Finset.sum_congr rfl fun i _ => ?_\n rw [integral_const_mul, integral_finsetSum _ fun j _ => (hint i j).mul_const (c j)]\n simp only [integral_mul_const]\n rw [hquad]\n exact integral_nonneg_of_ae (hM.mono fun x hx => hx.dotProduct_mulVec_nonneg c)", "proof_lines": 15, "proof_length": 809, "rev": "75c8aed5fea63047615a25a9763fd5b68a86e891", "heartbeats": 2245, "image": "lean-compression:tauceti-75c8aed5fe-a608030cfc", "split": "dev"} {"path": "TauCeti/NumberTheory/LSeries/RiemannZeta/LogDeriv/Local.lean", "module": "TauCeti.NumberTheory.LSeries.RiemannZeta.LogDeriv.Local", "theorem": "TauCeti.riemannZeta_local_logDeriv", "prefix": "/-\nCopyright (c) 2026 The Tau Ceti contributors. All rights reserved.\nReleased under Apache 2.0 license as described in the file LICENSE.\nAuthors: The Tau Ceti contributors\n-/\nmodule\n\npublic import Mathlib.Analysis.Analytic.Order\npublic import Mathlib.Analysis.Meromorphic.Divisor\npublic import Mathlib.NumberTheory.LSeries.DirichletContinuation\nimport TauCeti.Analysis.Complex.LocalLogDeriv\nimport TauCeti.Analysis.Meromorphic.Divisor\nimport TauCeti.Analysis.SpecialFunctions.Pow.Bounds\nimport TauCeti.NumberTheory.DirichletCharacter.LFunction.Basic\nimport TauCeti.NumberTheory.LSeries.DirichletEulerLog\nimport TauCeti.NumberTheory.LSeries.RiemannZeta.Growth\nimport TauCeti.NumberTheory.LSeries.RiemannZeta.LogDeriv.NearOne\n\n/-!\n# The local expansion of the logarithmic derivative of the Riemann zeta function\n\nFix a real `\u03c3\u2080 > 1` and radii `r < r'`. There is a constant `C`, depending only on\n`\u03c3\u2080, r, r'`, such that for every centre `s\u2080` with `Re s\u2080 = \u03c3\u2080` and every `s \u2260 1` with\n`\u2016s - s\u2080\u2016 \u2264 r` and `\u03b6(s) \u2260 0`,\n`\u2016\u03b6\u2032/\u03b6(s) + 1/(s - 1) - \u2211_{\u2016\u03c1 - s\u2080\u2016 \u2264 r'} m(\u03c1)/(s - \u03c1)\u2016 \u2264 C log(|Im s\u2080| + 2)`.\nThe sum runs over every zero `\u03c1` of `\u03b6` in the closed disc, trivial zeros included, weighted by\nits analytic order `m(\u03c1)`.\n\n## Main results\n\n* `TauCeti.divisor_LFunctionTrivChar\u2081_one_closedBall_apply`: the divisor of\n `LFunctionTrivChar\u2081 1` on a closed disc records the orders of the zeros of `\u03b6` in the disc.\n* `TauCeti.finsum_subtype_riemannZeta_eq_finsum_divisor`: the order-weighted sum over the zeros\n of `\u03b6` in a closed disc is the divisor sum of `LFunctionTrivChar\u2081 1` on that disc.\n* `TauCeti.exists_norm_LFunctionTrivChar\u2081_one_le_rpow_mul`: on discs centred on a line\n `Re s\u2080 = \u03c3\u2080 > 1`, `\u2016(w - 1) \u03b6(w)\u2016 \u2264 (|Im s\u2080| + 2) ^ D \u2016(s\u2080 - 1) \u03b6(s\u2080)\u2016`.\n* `TauCeti.riemannZeta_local_logDeriv`: the local expansion of `\u03b6\u2032/\u03b6`.\n\n## Implementation notes\n\nThe entire function `LFunctionTrivChar\u2081 1` has logarithmic derivative `\u03b6\u2032/\u03b6(s) + 1/(s - 1)` and\nthe same zeros and orders as `\u03b6`. Landau's local lemma, in the uniform\nform `TauCeti.exists_norm_logDeriv_sub_finsum_divisor_le`, on the discs of radii `r'` and `r' + 1`\nabout `s\u2080` turns a relative growth bound into the expansion. That bound,\n`TauCeti.exists_norm_LFunctionTrivChar\u2081_one_le_rpow_mul`, combines the disc bound\n`TauCeti.exists_norm_LFunctionTrivChar\u2081_one_le_rpow_of_norm_sub_le` with the centre lower bound\n`\u2016(s\u2080 - 1) \u03b6(s\u2080)\u2016 \u2265 (\u03c3\u2080 - 1) exp(-Re \u03b6(\u03c3\u2080))` from\n`DirichletCharacter.exp_neg_re_riemannZeta_le_norm_LFunction`.\n\n## References\n\n* D. Koukoulopoulos, *The Distribution of Prime Numbers*, Lemma 8.6, pp.90\u201391, and\n Lemma 11.2, p.113.\n* PrimeNumberTheoremAnd, `StrongPNT.lean` at revision `df0ccba`, proves a weaker `log\u00b2` bound on\n a fixed window about `3/2 + i t`; this file follows the nested-disc route instead.\n-/\n\npublic section\n\nopen Complex DirichletCharacter Metric Set Filter Topology\n\nnamespace TauCeti\n\n/-- On a closed disc, the divisor of the entire function `LFunctionTrivChar\u2081 1` is the analytic\norder of `\u03b6` at its zeros in the disc, and zero elsewhere. -/\ntheorem divisor_LFunctionTrivChar\u2081_one_closedBall_apply (s\u2080 \u03c1 : \u2102) (r' : \u211d) :\n MeromorphicOn.divisor (LFunctionTrivChar\u2081 1) (closedBall s\u2080 r') \u03c1 =\n if \u2016\u03c1 - s\u2080\u2016 \u2264 r' \u2227 riemannZeta \u03c1 = 0 then ((analyticOrderAt riemannZeta \u03c1).toNat : \u2124)\n else 0 := by\n have hF := (differentiable_LFunctionTrivChar\u2081 1).differentiableOn.analyticOnNhd isOpen_univ\n rw [(hF.mono (subset_univ _)).divisor_closedBall_apply]\n by_cases h\u03c1 : \u2016\u03c1 - s\u2080\u2016 \u2264 r' \u2227 riemannZeta \u03c1 = 0\n \u00b7 have h\u03c11 : \u03c1 \u2260 1 := by\n rintro rfl\n exact riemannZeta_one_ne_zero h\u03c1.2\n rw [ite_eq_left \u27e8h\u03c1.1, by rw [LFunctionTrivChar\u2081_one_apply_of_ne_one h\u03c11, h\u03c1.2, mul_zero]\u27e9,\n ite_eq_left h\u03c1, analyticOrderNatAt, analyticOrderAt_LFunctionTrivChar\u2081_one h\u03c11]\n \u00b7 rw [ite_eq_right h\u03c1,\n ite_eq_right fun h \u21a6 h\u03c1 \u27e8h.1, by_contra fun h\u03b6 \u21a6 LFunctionTrivChar\u2081_one_ne_zero h\u03b6 h.2\u27e9]\n\n/-- The zeros of `\u03b6` in a closed disc, weighted by analytic order, are the divisor of the entire\nfunction `LFunctionTrivChar\u2081 1` on that disc. -/\ntheorem finsum_subtype_riemannZeta_eq_finsum_divisor (s\u2080 s : \u2102) (r' : \u211d) :\n \u2211\u1da0 \u03c1 : {z : \u2102 // \u2016z - s\u2080\u2016 \u2264 r' \u2227 riemannZeta z = 0},\n ((analyticOrderAt riemannZeta \u03c1.val).toNat : \u2102) / (s - \u03c1.val) =\n \u2211\u1da0 \u03c1, (MeromorphicOn.divisor (LFunctionTrivChar\u2081 1) (closedBall s\u2080 r') \u03c1 : \u2102) /\n (s - \u03c1) := by\n refine (finsum_subtype_eq_finsum_cond (f := fun z \u21a6\n ((analyticOrderAt riemannZeta z).toNat : \u2102) / (s - z)) _).trans (finsum_congr fun \u03c1 \u21a6 ?_)\n rw [finsum_eq_if, divisor_LFunctionTrivChar\u2081_one_closedBall_apply]\n split_ifs <;> simp\n\n/-- The centre lower bound `\u2016(s\u2080 - 1) \u03b6(s\u2080)\u2016 \u2265 (\u03c3\u2080 - 1) exp(-Re \u03b6(\u03c3\u2080))` for `\u03c3\u2080 = Re s\u2080`. For\n`\u03c3\u2080 > 1` it comes from `DirichletCharacter.exp_neg_re_riemannZeta_le_norm_LFunction`; for `\u03c3\u2080 \u2264 1`\nthe left side is not positive. -/\nprivate theorem sub_one_mul_exp_neg_le_norm_LFunctionTrivChar\u2081_one (s\u2080 : \u2102) :\n (s\u2080.re - 1) * Real.exp (-(riemannZeta s\u2080.re).re) \u2264 \u2016LFunctionTrivChar\u2081 1 s\u2080\u2016 := by\n rcases le_or_gt s\u2080.re 1 with h | hs\u2080\n \u00b7 exact (mul_nonpos_of_nonpos_of_nonneg (by linarith) (Real.exp_pos _).le).trans (norm_nonneg _)\n have hs\u20801 : s\u2080 \u2260 1 := fun h \u21a6 by simp [h] at hs\u2080\n rw [LFunctionTrivChar\u2081_one_apply_of_ne_one hs\u20801, norm_mul]\n gcongr\n \u00b7 simpa using re_le_norm (s\u2080 - 1)\n \u00b7 simpa using (1 : DirichletCharacter \u2102 1).exp_neg_re_riemannZeta_le_norm_LFunction hs\u2080\n\n/-- **Relative growth of `(s - 1) \u03b6(s)` on discs.** For real `\u03c3\u2080 > 1` and a radius `R` there is\nan exponent `D` such that `\u2016(w - 1) \u03b6(w)\u2016 \u2264 (|Im s\u2080| + 2) ^ D \u2016(s\u2080 - 1) \u03b6(s\u2080)\u2016` for every centre\n`s\u2080` with `Re s\u2080 = \u03c3\u2080` and every `w` with `\u2016w - s\u2080\u2016 \u2264 R`. -/\ntheorem exists_norm_LFunctionTrivChar\u2081_one_le_rpow_mul {\u03c3\u2080 : \u211d} (h\u03c3\u2080 : 1 < \u03c3\u2080) (R : \u211d) :\n \u2203 D : \u211d, \u2200 s\u2080 w : \u2102, s\u2080.re = \u03c3\u2080 \u2192 \u2016w - s\u2080\u2016 \u2264 R \u2192\n \u2016LFunctionTrivChar\u2081 1 w\u2016 \u2264 (|s\u2080.im| + 2) ^ D * \u2016LFunctionTrivChar\u2081 1 s\u2080\u2016 := by\n obtain \u27e8K, B, -, hdisc\u27e9 := exists_norm_LFunctionTrivChar\u2081_one_le_rpow_of_norm_sub_le \u03c3\u2080 R\n obtain \u27e8D, hD\u27e9 := Real.exists_mul_rpow_le_rpow_mul K B\n (mul_pos (by linarith) (Real.exp_pos _) : 0 < (\u03c3\u2080 - 1) * Real.exp (-(riemannZeta \u03c3\u2080).re))\n one_lt_two\n refine \u27e8D, fun s\u2080 w hs\u2080 hw \u21a6 (hdisc s\u2080 w hs\u2080 hw).trans (hD _ _ (by simp) ?_)\u27e9\n simpa [hs\u2080] using sub_one_mul_exp_neg_le_norm_LFunctionTrivChar\u2081_one s\u2080\n\n", "statement": "/-- **The local expansion of `\u03b6\u2032/\u03b6`.** For real `\u03c3\u2080 > 1` and radii `r < r'` there is a\nconstant `C` such that for every `s\u2080` with `Re s\u2080 = \u03c3\u2080` and every `s \u2260 1` with `\u2016s - s\u2080\u2016 \u2264 r` and\n`\u03b6(s) \u2260 0`, `\u03b6\u2032/\u03b6(s) + 1/(s - 1)` differs from `\u2211 m(\u03c1)/(s - \u03c1)` over the zeros `\u03c1` of `\u03b6` with\n`\u2016\u03c1 - s\u2080\u2016 \u2264 r'`, counted with analytic order `m(\u03c1)`, by at most `C log(|Im s\u2080| + 2)`. -/\ntheorem riemannZeta_local_logDeriv {\u03c3\u2080 r r' : \u211d} (h\u03c3\u2080 : 1 < \u03c3\u2080) (hrr' : r < r') :\n \u2203 C : \u211d, \u2200 s\u2080 s : \u2102, s\u2080.re = \u03c3\u2080 \u2192 \u2016s - s\u2080\u2016 \u2264 r \u2192 s \u2260 1 \u2192 riemannZeta s \u2260 0 \u2192\n \u2016deriv riemannZeta s / riemannZeta s + 1 / (s - 1) -\n \u2211\u1da0 \u03c1 : {z : \u2102 // \u2016z - s\u2080\u2016 \u2264 r' \u2227 riemannZeta z = 0},\n ((analyticOrderAt riemannZeta \u03c1.val).toNat : \u2102) / (s - \u03c1.val)\u2016 \u2264\n C * Real.log (|s\u2080.im| + 2) ", "proof": " by\n have hF := (differentiable_LFunctionTrivChar\u2081 1).differentiableOn.analyticOnNhd isOpen_univ\n obtain \u27e8D, hD\u27e9 := exists_norm_LFunctionTrivChar\u2081_one_le_rpow_mul h\u03c3\u2080 (r' + 1)\n obtain \u27e8A, hA\u27e9 := exists_norm_logDeriv_sub_finsum_divisor_le hrr' (lt_add_one r')\n refine \u27e8A * D, fun s\u2080 s hs\u2080 hs hs1 h\u03b6 \u21a6 ?_\u27e9\n have key := hA (hF.mono (subset_univ (closedBall s\u2080 (r' + 1))))\n (fun w hw \u21a6 hD s\u2080 w hs\u2080 (by rw [mem_sphere, dist_eq_norm] at hw; exact hw.le))\n (LFunctionTrivChar\u2081_one_ne_zero (riemannZeta_ne_zero_of_one_lt_re (by linarith))) hs\n (LFunctionTrivChar\u2081_one_ne_zero h\u03b6)\n rw [\u2190 logDeriv_riemannZeta_add_inv_sub_one hs1 h\u03b6, logDeriv_apply,\n \u2190 finsum_subtype_riemannZeta_eq_finsum_divisor, \u2190 one_div,\n Real.log_rpow (by positivity)] at key\n exact key.trans_eq (by ring)", "proof_lines": 12, "proof_length": 755, "rev": "75c8aed5fea63047615a25a9763fd5b68a86e891", "heartbeats": 952, "image": "lean-compression:tauceti-75c8aed5fe-a608030cfc", "split": "dev"} {"path": "TauCeti/Geometry/RealAlgebraic/Nash/LocallySemialgebraic.lean", "module": "TauCeti.Geometry.RealAlgebraic.Nash.LocallySemialgebraic", "theorem": "TauCeti.semialgebraicAt_iff_exists_isNashBooleanCombination", "prefix": "/-\nCopyright (c) 2026 The Tau Ceti contributors. All rights reserved.\nReleased under Apache 2.0 license as described in the file LICENSE.\nAuthors: The Tau Ceti contributors\n-/\nmodule\n\npublic import TauCeti.Geometry.RealAlgebraic.Nash.Comp\npublic import TauCeti.Geometry.RealAlgebraic.Semialgebraic.Local\n\n/-!\n# Locally semialgebraic sets and Nash germs\n\nLocally semialgebraic sets (`TauCeti.IsLocallySemialgebraic`) are the sets of the Nash category:\nnear every point they are cut out by sign conditions on Nash germs, and their preimages under Nash\nmaps are again locally semialgebraic. This file proves both facts.\n\nA map `g : (\u03c3 \u2192 \u211d) \u2192 (\u03c4 \u2192 \u211d)` is treated as a Nash map germ at `x` when each of its coordinates is\na Nash germ at `x` (`TauCeti.IsNashAt`). The preimage of a set semialgebraic at `g x` under such a\nmap is semialgebraic at `x`, since the graph of `g` is semialgebraic on a neighbourhood of `x`.\nConsequently global Nash bijections between coordinate spaces, whose inverses are also Nash,\ntransport locally semialgebraic sets.\n\nWe record the finite Boolean combinations of zero sets `{y | f y = 0}` and positivity sets\n`{y | 0 < f y}` of functions `f` that are Nash germs at every point of `U` as\n`TauCeti.IsNashBooleanCombination U t`, in the same way as\n`TauCeti.IsAnalyticBooleanCombination` for analytic functions. A set is semialgebraic at `x`\nexactly when, on a neighbourhood `U` of `x`, it agrees with such a combination, and every such\ncombination is described by a condition on the signs of finitely many such functions. One direction\nholds because polynomials are Nash germs everywhere; for the other, every Nash germ has\nsemialgebraic graph near its point, so its zero and positivity sets are semialgebraic at that point.\n\n## Main declarations\n\n* `TauCeti.IsNashBooleanCombination U t`: `t` is a finite Boolean combination of zero sets and\n positivity sets of functions that are Nash germs at every point of `U`.\n\n## Main results\n\n* `TauCeti.SemialgebraicAt.preimage`, `TauCeti.IsLocallySemialgebraic.preimage`: preimages under\n maps with Nash coordinates.\n* `Equiv.semialgebraicAt_image_iff`, `Equiv.isLocallySemialgebraic_image_iff`: invariance under\n bijections that are Nash with Nash inverses.\n* `TauCeti.IsNashAt.semialgebraicAt_setOf_eq_zero`, `TauCeti.IsNashAt.semialgebraicAt_setOf_pos`:\n the zero and positivity sets of a Nash germ at `x` are semialgebraic at `x`.\n* `TauCeti.IsNashBooleanCombination.exists_eq_setOf_sign`: the sign-condition normal form of a\n Boolean combination of Nash sign conditions.\n* `TauCeti.semialgebraicAt_iff_exists_isNashBooleanCombination`: a set is semialgebraic at `x` if\n and only if near `x` it agrees with a finite Boolean combination of sign conditions on functions\n that are Nash germs on a neighbourhood of `x`.\n* `TauCeti.IsNashBooleanCombination.preimage`: preimages of these combinations under maps with\n Nash coordinates, and `TauCeti.IsNashBooleanCombination.isAnalyticBooleanCombination`: they are in\n particular Boolean combinations of analytic sign conditions.\n\n## References\n\n* S. \u0141ojasiewicz, *Triangulation of semi-analytic sets*, Annali della Scuola Normale Superiore di\n Pisa (3) 18 (1964), 449\u2013474, \u00a71.\n* J. Bochnak, M. Coste, M.-F. Roy, *Real Algebraic Geometry*, Ergebnisse der Mathematik und ihrer\n Grenzgebiete (3) 36, Springer, 1998, Section 8.1 (Nash functions).\n-/\n\npublic section\n\nopen Filter MeasureTheory MvPolynomial Set Topology\n\nnamespace TauCeti\n\nvariable {\u03c3 \u03c4 : Type*} [Fintype \u03c3]\n\n/-! ### Preimages under Nash maps -/\n\n/-- **Nash preimages.** The preimage of a set semialgebraic at `g x` under a map `g` whose\ncoordinates are Nash germs at `x` is semialgebraic at `x`. -/\ntheorem SemialgebraicAt.preimage [Finite \u03c4] {s : Set (\u03c4 \u2192 \u211d)} {g : (\u03c3 \u2192 \u211d) \u2192 (\u03c4 \u2192 \u211d)} {x : \u03c3 \u2192 \u211d}\n (hs : SemialgebraicAt s (g x)) (hg : \u2200 i, IsNashAt (fun y \u21a6 g y i) x) :\n SemialgebraicAt (g \u207b\u00b9' s) x := by\n cases nonempty_fintype \u03c4\n obtain \u27e8hga, W, hWo, hxW, hgW\u27e9 := forall_isNashAt_apply_iff_exists_isSemialgebraicOn.mp hg\n obtain \u27e8U, hUo, hgxU, -, hsU\u27e9 := semialgebraicAt_def.mp hs\n obtain \u27e8\u03b5, h\u03b5, h\u03b5V\u27e9 := Metric.mem_nhds_iff.mp <| inter_mem (hWo.mem_nhds hxW)\n (hga.continuousAt.preimage_mem_nhds (hUo.mem_nhds hgxU))\n refine semialgebraicAt_iff_exists_ball.mpr \u27e8\u03b5, h\u03b5, ?_\u27e9\n convert (hgW.isSemialgebraic_inter_preimage hsU).inter (isSemialgebraic_ball x \u03b5) using 1\n ext y\n simp only [mem_inter_iff, mem_preimage]\n exact \u27e8fun \u27e8hy, hy\u03b5\u27e9 \u21a6 \u27e8\u27e8(h\u03b5V hy\u03b5).1, hy, (h\u03b5V hy\u03b5).2\u27e9, hy\u03b5\u27e9,\n fun \u27e8\u27e8_, hy, _\u27e9, hy\u03b5\u27e9 \u21a6 \u27e8hy, hy\u03b5\u27e9\u27e9\n\n/-- **Nash preimages.** The preimage of a locally semialgebraic set under a map whose coordinates\nare Nash germs at every point is locally semialgebraic. -/\ntheorem IsLocallySemialgebraic.preimage [Finite \u03c4] {s : Set (\u03c4 \u2192 \u211d)} (hs : IsLocallySemialgebraic s)\n {g : (\u03c3 \u2192 \u211d) \u2192 (\u03c4 \u2192 \u211d)} (hg : \u2200 x i, IsNashAt (fun y \u21a6 g y i) x) :\n IsLocallySemialgebraic (g \u207b\u00b9' s) :=\n isLocallySemialgebraic_iff.mpr fun x \u21a6 (hs.semialgebraicAt (g x)).preimage (hg x)\n\n/-- **Nash isomorphisms, locally.** For a bijection `e` whose coordinates are Nash germs at `x`\nand whose inverse has coordinates that are Nash germs at `e x`, the image `e '' s` is semialgebraic\nat `e x` if and only if `s` is semialgebraic at `x`. -/\ntheorem _root_.Equiv.semialgebraicAt_image_iff [Fintype \u03c4] {s : Set (\u03c3 \u2192 \u211d)} {x : \u03c3 \u2192 \u211d}\n (e : (\u03c3 \u2192 \u211d) \u2243 (\u03c4 \u2192 \u211d)) (he : \u2200 i, IsNashAt (fun y \u21a6 e y i) x)\n (he' : \u2200 i, IsNashAt (fun y \u21a6 e.symm y i) (e x)) :\n SemialgebraicAt (e '' s) (e x) \u2194 SemialgebraicAt s x := by\n rw [e.image_eq_preimage_symm]\n refine \u27e8fun hs \u21a6 ?_, fun hs \u21a6 .preimage (by rwa [e.symm_apply_apply]) he'\u27e9\n simpa [preimage_preimage] using hs.preimage he\n\n/-- **Nash isomorphisms.** For a bijection `e` whose coordinates and whose inverse's coordinates\nare Nash germs at every point, the image `e '' s` is locally semialgebraic if and only if `s` is\nlocally semialgebraic. -/\ntheorem _root_.Equiv.isLocallySemialgebraic_image_iff [Fintype \u03c4] {s : Set (\u03c3 \u2192 \u211d)}\n (e : (\u03c3 \u2192 \u211d) \u2243 (\u03c4 \u2192 \u211d)) (he : \u2200 x i, IsNashAt (fun y \u21a6 e y i) x)\n (he' : \u2200 x i, IsNashAt (fun y \u21a6 e.symm y i) x) :\n IsLocallySemialgebraic (e '' s) \u2194 IsLocallySemialgebraic s := by\n rw [e.image_eq_preimage_symm]\n refine \u27e8fun hs \u21a6 ?_, fun hs \u21a6 hs.preimage he'\u27e9\n simpa [preimage_preimage] using hs.preimage he\n\n/-! ### Sign conditions on Nash germs -/\n\n/-- The zero set of a Nash germ at `x` is semialgebraic at `x`. -/\ntheorem IsNashAt.semialgebraicAt_setOf_eq_zero {f : (\u03c3 \u2192 \u211d) \u2192 \u211d} {x : \u03c3 \u2192 \u211d}\n (hf : IsNashAt f x) : SemialgebraicAt {y | f y = 0} x := by\n simpa using ((isSemialgebraic_eval_eq_zero (X () : MvPolynomial Unit \u211d)).semialgebraicAt _\n ).preimage (g := fun y _ \u21a6 f y) fun _ \u21a6 hf\n\n/-- The positivity set of a Nash germ at `x` is semialgebraic at `x`. -/\ntheorem IsNashAt.semialgebraicAt_setOf_pos {f : (\u03c3 \u2192 \u211d) \u2192 \u211d} {x : \u03c3 \u2192 \u211d}\n (hf : IsNashAt f x) : SemialgebraicAt {y | 0 < f y} x := by\n simpa using ((isSemialgebraic_eval_pos (X () : MvPolynomial Unit \u211d)).semialgebraicAt _\n ).preimage (g := fun y _ \u21a6 f y) fun _ \u21a6 hf\n\n/-! ### Finite Boolean combinations of Nash sign conditions -/\n\n/-- A set `t \u2286 \u03c3 \u2192 \u211d` is a *finite Boolean combination of Nash sign conditions on `U`* if it\nbelongs to the algebra of sets generated by the zero sets `{y | f y = 0}` and the positivity sets\n`{y | 0 < f y}` of the real functions `f` that are Nash germs at every point of `U`. Only the part\nof `t` inside `U` is meaningful for local semialgebraicity. -/\ndef IsNashBooleanCombination (U t : Set (\u03c3 \u2192 \u211d)) : Prop :=\n t \u2208 generateSetAlgebra\n ({t | \u2203 f : (\u03c3 \u2192 \u211d) \u2192 \u211d, (\u2200 y \u2208 U, IsNashAt f y) \u2227 t = {y | f y = 0}} \u222a\n {t | \u2203 f : (\u03c3 \u2192 \u211d) \u2192 \u211d, (\u2200 y \u2208 U, IsNashAt f y) \u2227 t = {y | 0 < f y}})\n\n/-- A set is a finite Boolean combination of Nash sign conditions on `U` if and only if it belongs\nto the algebra of sets generated by the zero sets and positivity sets of the functions that are\nNash germs at every point of `U`. -/\ntheorem isNashBooleanCombination_def {U t : Set (\u03c3 \u2192 \u211d)} :\n IsNashBooleanCombination U t \u2194 t \u2208 generateSetAlgebra\n ({t | \u2203 f : (\u03c3 \u2192 \u211d) \u2192 \u211d, (\u2200 y \u2208 U, IsNashAt f y) \u2227 t = {y | f y = 0}} \u222a\n {t | \u2203 f : (\u03c3 \u2192 \u211d) \u2192 \u211d, (\u2200 y \u2208 U, IsNashAt f y) \u2227 t = {y | 0 < f y}}) :=\n Iff.rfl\n\n/-- The zero set of a function that is a Nash germ at every point of `U` is a Boolean combination\nof Nash sign conditions on `U`. -/\ntheorem isNashBooleanCombination_setOf_eq_zero {U : Set (\u03c3 \u2192 \u211d)} {f : (\u03c3 \u2192 \u211d) \u2192 \u211d}\n (hf : \u2200 y \u2208 U, IsNashAt f y) : IsNashBooleanCombination U {y | f y = 0} :=\n self_subset_generateSetAlgebra (Or.inl \u27e8f, hf, rfl\u27e9)\n\n/-- The positivity set of a function that is a Nash germ at every point of `U` is a Boolean\ncombination of Nash sign conditions on `U`. -/\ntheorem isNashBooleanCombination_setOf_pos {U : Set (\u03c3 \u2192 \u211d)} {f : (\u03c3 \u2192 \u211d) \u2192 \u211d}\n (hf : \u2200 y \u2208 U, IsNashAt f y) : IsNashBooleanCombination U {y | 0 < f y} :=\n self_subset_generateSetAlgebra (Or.inr \u27e8f, hf, rfl\u27e9)\n\n/-- The finite Boolean combinations of Nash sign conditions on `U` form an algebra of sets. -/\ntheorem isSetAlgebra_setOf_isNashBooleanCombination (U : Set (\u03c3 \u2192 \u211d)) :\n IsSetAlgebra {t : Set (\u03c3 \u2192 \u211d) | IsNashBooleanCombination U t} :=\n isSetAlgebra_generateSetAlgebra\n\n/-- The finite Boolean combinations of Nash sign conditions on `U` form the smallest algebra of\nsets containing the zero set and the positivity set of every function that is a Nash germ at every\npoint of `U`. -/\ntheorem setOf_isNashBooleanCombination_subset {U : Set (\u03c3 \u2192 \u211d)} {\u212c : Set (Set (\u03c3 \u2192 \u211d))}\n (h\u212c : IsSetAlgebra \u212c)\n (eq_zero : \u2200 f : (\u03c3 \u2192 \u211d) \u2192 \u211d, (\u2200 y \u2208 U, IsNashAt f y) \u2192 {y | f y = 0} \u2208 \u212c)\n (pos : \u2200 f : (\u03c3 \u2192 \u211d) \u2192 \u211d, (\u2200 y \u2208 U, IsNashAt f y) \u2192 {y | 0 < f y} \u2208 \u212c) :\n {t : Set (\u03c3 \u2192 \u211d) | IsNashBooleanCombination U t} \u2286 \u212c :=\n h\u212c.generateSetAlgebra_subset <| union_subset (fun _ \u27e8f, hf, h\u27e9 \u21a6 h \u25b8 eq_zero f hf)\n (fun _ \u27e8f, hf, h\u27e9 \u21a6 h \u25b8 pos f hf)\n\n/-- The empty set is a Boolean combination of Nash sign conditions. -/\n@[simp]\ntheorem isNashBooleanCombination_empty (U : Set (\u03c3 \u2192 \u211d)) :\n IsNashBooleanCombination U (\u2205 : Set (\u03c3 \u2192 \u211d)) :=\n (isSetAlgebra_setOf_isNashBooleanCombination U).empty_mem\n\n/-- The whole space is a Boolean combination of Nash sign conditions. -/\n@[simp]\ntheorem isNashBooleanCombination_univ (U : Set (\u03c3 \u2192 \u211d)) :\n IsNashBooleanCombination U (univ : Set (\u03c3 \u2192 \u211d)) :=\n (isSetAlgebra_setOf_isNashBooleanCombination U).univ_mem\n\n/-- A semialgebraic set is a Boolean combination of Nash sign conditions on every set `U`, since\npolynomial functions are Nash germs everywhere. -/\ntheorem IsSemialgebraic.isNashBooleanCombination {t : Set (\u03c3 \u2192 \u211d)} (ht : IsSemialgebraic t)\n (U : Set (\u03c3 \u2192 \u211d)) : IsNashBooleanCombination U t :=\n setOf_isSemialgebraic_subset (isSetAlgebra_setOf_isNashBooleanCombination U)\n (fun p \u21a6 isNashBooleanCombination_setOf_eq_zero fun _ _ \u21a6 p.isNashAt_eval)\n (fun p \u21a6 isNashBooleanCombination_setOf_pos fun _ _ \u21a6 p.isNashAt_eval) ht\n\nnamespace IsNashBooleanCombination\n\nvariable {U V t t' : Set (\u03c3 \u2192 \u211d)}\n\n/-- The complement of a Boolean combination of Nash sign conditions is one. -/\ntheorem compl (ht : IsNashBooleanCombination U t) : IsNashBooleanCombination U t\u1d9c :=\n (isSetAlgebra_setOf_isNashBooleanCombination U).compl_mem ht\n\n/-- The union of two Boolean combinations of Nash sign conditions is one. -/\ntheorem union (ht : IsNashBooleanCombination U t) (ht' : IsNashBooleanCombination U t') :\n IsNashBooleanCombination U (t \u222a t') :=\n (isSetAlgebra_setOf_isNashBooleanCombination U).union_mem ht ht'\n\n/-- The intersection of two Boolean combinations of Nash sign conditions is one. -/\ntheorem inter (ht : IsNashBooleanCombination U t) (ht' : IsNashBooleanCombination U t') :\n IsNashBooleanCombination U (t \u2229 t') :=\n (isSetAlgebra_setOf_isNashBooleanCombination U).inter_mem ht ht'\n\n/-- The difference of two Boolean combinations of Nash sign conditions is one. -/\ntheorem sdiff (ht : IsNashBooleanCombination U t) (ht' : IsNashBooleanCombination U t') :\n IsNashBooleanCombination U (t \\ t') :=\n (isSetAlgebra_setOf_isNashBooleanCombination U).sdiff_mem ht ht'\n\n/-- A finite union of Boolean combinations of Nash sign conditions is one. -/\nprotected theorem biUnion {\u03b9 : Type*} {I : Set \u03b9} (hI : I.Finite) {t : \u03b9 \u2192 Set (\u03c3 \u2192 \u211d)}\n (ht : \u2200 i \u2208 I, IsNashBooleanCombination U (t i)) :\n IsNashBooleanCombination U (\u22c3 i \u2208 I, t i) := by\n simpa using (isSetAlgebra_setOf_isNashBooleanCombination U).biUnion_mem hI.toFinset\n fun i hi \u21a6 ht i (hI.mem_toFinset.1 hi)\n\n/-- A finite intersection of Boolean combinations of Nash sign conditions is one. -/\nprotected theorem biInter {\u03b9 : Type*} {I : Set \u03b9} (hI : I.Finite) {t : \u03b9 \u2192 Set (\u03c3 \u2192 \u211d)}\n (ht : \u2200 i \u2208 I, IsNashBooleanCombination U (t i)) :\n IsNashBooleanCombination U (\u22c2 i \u2208 I, t i) := by\n simpa using (isSetAlgebra_setOf_isNashBooleanCombination U).biInter_mem hI.toFinset\n fun i hi \u21a6 ht i (hI.mem_toFinset.1 hi)\n\n/-- The union of a finite family of Boolean combinations of Nash sign conditions is one. -/\nprotected theorem iUnion {\u03b9 : Type*} [Finite \u03b9] {t : \u03b9 \u2192 Set (\u03c3 \u2192 \u211d)}\n (ht : \u2200 i, IsNashBooleanCombination U (t i)) :\n IsNashBooleanCombination U (\u22c3 i, t i) := by\n simpa using IsNashBooleanCombination.biUnion finite_univ fun i (_ : i \u2208 univ) \u21a6 ht i\n\n/-- The intersection of a finite family of Boolean combinations of Nash sign conditions is one. -/\nprotected theorem iInter {\u03b9 : Type*} [Finite \u03b9] {t : \u03b9 \u2192 Set (\u03c3 \u2192 \u211d)}\n (ht : \u2200 i, IsNashBooleanCombination U (t i)) :\n IsNashBooleanCombination U (\u22c2 i, t i) := by\n simpa using IsNashBooleanCombination.biInter finite_univ fun i (_ : i \u2208 univ) \u21a6 ht i\n\n/-- A Boolean combination of sign conditions of functions that are Nash germs on `U` is also one\nfor any smaller set `V \u2286 U`. -/\ntheorem mono (ht : IsNashBooleanCombination U t) (hVU : V \u2286 U) :\n IsNashBooleanCombination V t :=\n setOf_isNashBooleanCombination_subset (isSetAlgebra_setOf_isNashBooleanCombination V)\n (fun _ hf \u21a6 isNashBooleanCombination_setOf_eq_zero fun y hy \u21a6 hf y (hVU hy))\n (fun _ hf \u21a6 isNashBooleanCombination_setOf_pos fun y hy \u21a6 hf y (hVU hy)) ht\n\n/-- The preimage of a Boolean combination of Nash sign conditions on `U` under a map `g` whose\ncoordinates are Nash germs at every point of `V`, and which maps `V` into `U`, is a Boolean\ncombination of Nash sign conditions on `V`. -/\ntheorem preimage [Fintype \u03c4] {U t : Set (\u03c4 \u2192 \u211d)} (ht : IsNashBooleanCombination U t)\n {g : (\u03c3 \u2192 \u211d) \u2192 (\u03c4 \u2192 \u211d)} (hg : \u2200 y \u2208 V, \u2200 i, IsNashAt (fun z \u21a6 g z i) y)\n (hgVU : MapsTo g V U) : IsNashBooleanCombination V (g \u207b\u00b9' t) :=\n setOf_isNashBooleanCombination_subset\n ((isSetAlgebra_setOf_isNashBooleanCombination V).preimage g)\n (fun _ hf \u21a6 isNashBooleanCombination_setOf_eq_zero fun y hy \u21a6 (hf _ (hgVU hy)).comp (hg y hy))\n (fun _ hf \u21a6 isNashBooleanCombination_setOf_pos fun y hy \u21a6 (hf _ (hgVU hy)).comp (hg y hy)) ht\n\n/-- A Boolean combination of Nash sign conditions on `U` is a Boolean combination of analytic sign\nconditions on `U`. -/\ntheorem isAnalyticBooleanCombination (ht : IsNashBooleanCombination U t) :\n IsAnalyticBooleanCombination U t :=\n setOf_isNashBooleanCombination_subset (isSetAlgebra_setOf_isAnalyticBooleanCombination U)\n (fun _ hf \u21a6 isAnalyticBooleanCombination_setOf_eq_zero fun y hy \u21a6 (hf y hy).analyticAt)\n (fun _ hf \u21a6 isAnalyticBooleanCombination_setOf_pos fun y hy \u21a6 (hf y hy).analyticAt) ht\n\n/-- A Boolean combination of Nash sign conditions on `U` is semialgebraic at every point of\n`U`. -/\ntheorem semialgebraicAt (ht : IsNashBooleanCombination U t) {x : \u03c3 \u2192 \u211d} (hx : x \u2208 U) :\n SemialgebraicAt t x :=\n setOf_isNashBooleanCombination_subset (isSetAlgebra_setOf_semialgebraicAt x)\n (fun _ hf \u21a6 (hf x hx).semialgebraicAt_setOf_eq_zero)\n (fun _ hf \u21a6 (hf x hx).semialgebraicAt_setOf_pos) ht\n\nend IsNashBooleanCombination\n\n/-- The set where a function that is a Nash germ at every point of `U` has a prescribed sign is a\nBoolean combination of Nash sign conditions on `U`. -/\ntheorem isNashBooleanCombination_setOf_sign_eq {U : Set (\u03c3 \u2192 \u211d)} {f : (\u03c3 \u2192 \u211d) \u2192 \u211d}\n (hf : \u2200 y \u2208 U, IsNashAt f y) (\u03b5 : SignType) :\n IsNashBooleanCombination U {y | SignType.sign (f y) = \u03b5} := by\n rcases \u03b5 with _ | _ | _\n \u00b7 simpa only [SignType.zero_eq_zero, sign_eq_zero_iff] using\n isNashBooleanCombination_setOf_eq_zero hf\n \u00b7 simpa only [SignType.neg_eq_neg_one, sign_eq_neg_one_iff, Pi.neg_apply, neg_pos] using\n isNashBooleanCombination_setOf_pos fun y hy \u21a6 (hf y hy).neg\n \u00b7 simpa only [SignType.pos_eq_one, sign_eq_one_iff] using\n isNashBooleanCombination_setOf_pos hf\n\n/-- A condition on the signs of finitely many functions that are Nash germs at every point of `U`\ndefines a Boolean combination of Nash sign conditions on `U`. -/\ntheorem isNashBooleanCombination_setOf_sign {U : Set (\u03c3 \u2192 \u211d)} {\u03b9 : Type*} [Finite \u03b9]\n {f : \u03b9 \u2192 (\u03c3 \u2192 \u211d) \u2192 \u211d} (hf : \u2200 i, \u2200 y \u2208 U, IsNashAt (f i) y) (\u03a6 : (\u03b9 \u2192 SignType) \u2192 Prop) :\n IsNashBooleanCombination U {y | \u03a6 fun i \u21a6 SignType.sign (f i y)} := by\n rw [setOf_apply_eq_biUnion_iInter (fun i y \u21a6 SignType.sign (f i y))]\n exact .biUnion (toFinite _) fun \u03b5 _ \u21a6\n .iInter fun i \u21a6 isNashBooleanCombination_setOf_sign_eq (hf i) (\u03b5 i)\n\n/-- **Sign-condition normal form.** A Boolean combination of Nash sign conditions on `U` is\ndescribed by a condition on the signs of finitely many functions that are Nash germs at every\npoint of `U`. -/\ntheorem IsNashBooleanCombination.exists_eq_setOf_sign {U t : Set (\u03c3 \u2192 \u211d)}\n (ht : IsNashBooleanCombination U t) :\n \u2203 (m : \u2115) (f : Fin m \u2192 (\u03c3 \u2192 \u211d) \u2192 \u211d), (\u2200 i, \u2200 y \u2208 U, IsNashAt (f i) y) \u2227\n \u2203 \u03a6 : (Fin m \u2192 SignType) \u2192 Prop, t = {y | \u03a6 fun i \u21a6 SignType.sign (f i y)} :=\n exists_eq_setOf_sign_of_mem_generateSetAlgebra ht\n\n", "statement": "/-- **Nash presentations of locally semialgebraic sets.** A set is semialgebraic at `x` if and only\nif on some neighbourhood `U` of `x` it agrees with a finite Boolean combination of zero sets and\npositivity sets of functions that are Nash germs at every point of `U`. -/\ntheorem semialgebraicAt_iff_exists_isNashBooleanCombination {s : Set (\u03c3 \u2192 \u211d)} {x : \u03c3 \u2192 \u211d} :\n SemialgebraicAt s x \u2194\n \u2203 U \u2208 \ud835\udcdd x, \u2203 t, IsNashBooleanCombination U t \u2227 s \u2229 U = t \u2229 U ", "proof": " by\n constructor\n \u00b7 intro hs\n obtain \u27e8U, hUo, hxU, -, hsU\u27e9 := semialgebraicAt_def.mp hs\n exact \u27e8U, hUo.mem_nhds hxU, s \u2229 U, hsU.isNashBooleanCombination U, by\n rw [inter_assoc, inter_self]\u27e9\n \u00b7 rintro \u27e8U, hU, t, ht, hst\u27e9\n refine (ht.semialgebraicAt (mem_of_mem_nhds hU)).congr ?_\n filter_upwards [hU] with y hy\n have := Set.ext_iff.mp hst y\n simp only [mem_inter_iff, hy, and_true] at this\n exact this.symm", "proof_lines": 11, "proof_length": 393, "rev": "75c8aed5fea63047615a25a9763fd5b68a86e891", "heartbeats": 152, "image": "lean-compression:tauceti-75c8aed5fe-a608030cfc", "split": "dev"} {"path": "TauCeti/NumberTheory/ArithmeticDirichletSeries/Riesz/Bounds.lean", "module": "TauCeti.NumberTheory.ArithmeticDirichletSeries.Riesz.Bounds", "theorem": "TauCeti.sum_prime_weight_mul_max_mem_Icc", "prefix": "/-\nCopyright (c) 2026 The Tau Ceti contributors. All rights reserved.\nReleased under Apache 2.0 license as described in the file LICENSE.\nAuthors: The Tau Ceti contributors\n-/\nmodule\n\npublic import Mathlib.NumberTheory.ArithmeticFunction.VonMangoldt\nimport TauCeti.NumberTheory.Chebyshev.LogFactorial\n\n/-!\n# Bounds for prime sums with varying cutoffs\n\nA first Riesz weight of the form `(y / n - w n)\u208a` lets the cutoff depend on the prime power `n`.\nIf every one of these cutoffs is at most `X`, the whole sum with coefficients between `0` and\n`2\u039b` is at most `4y log X`, regardless of the outer summation limit. This applies in\nparticular when `w n` is read at the place reached by the Frobenius of `n`.\n\n## References\n\n* `New.Data.primeSum_mem_Icc` in `New/Reduction/PrimeSums.lean` of `lsernau/grh-lean`\n (commit `72fead1`) gives the bound for the prime sums at infinite places.\n-/\n\npublic section\n\nopen Finset ArithmeticFunction\nopen scoped Nat\n\nnamespace TauCeti\n\n", "statement": "/-- Nonnegative prime weights bounded by twice von Mangoldt give a capped sum in\n`[0, 4y log X]` when `X * w n \u2265 y` at each summation index. -/\ntheorem sum_prime_weight_mul_max_mem_Icc {a w : \u2115 \u2192 \u211d} {N : \u2115} {y X : \u211d}\n (hy : 0 \u2264 y) (hX : 1 \u2264 X)\n (ha : \u2200 n \u2208 Ioc 0 N, a n \u2208 Set.Icc 0 (2 * \u039b n))\n (hw : \u2200 n \u2208 Ioc 0 N, y \u2264 X * w n) :\n (\u2211 n \u2208 Ioc 0 N, a n * max (y / n - w n) 0) \u2208 Set.Icc 0 (4 * y * Real.log X) ", "proof": " by\n refine \u27e8sum_nonneg fun n hn \u21a6 mul_nonneg (ha n hn).1 (le_max_right ..), ?_\u27e9\n have hX\u2080 : 0 < X := zero_lt_one.trans_le hX\n let S := Ioc 0 N \u2229 Ioc 0 \u230aX\u230b\u208a\n have hS\u2081 : S \u2286 Ioc 0 N := inter_subset_left\n have hS\u2082 : S \u2286 Ioc 0 \u230aX\u230b\u208a := inter_subset_right\n have hw\u2080 (n : \u2115) (hn : n \u2208 Ioc 0 N) : 0 \u2264 w n :=\n nonneg_of_mul_nonneg_right (hy.trans (hw n hn)) hX\u2080\n have hsupport (n : \u2115) (hn : n \u2208 Ioc 0 N) (hnS : n \u2209 S) :\n a n * max (y / n - w n) 0 = 0 := by\n have hXn : X \u2264 n := le_of_not_ge fun h \u21a6 hnS <| mem_inter.mpr\n \u27e8hn, mem_Ioc.mpr \u27e8(mem_Ioc.mp hn).1, (Nat.le_floor_iff hX\u2080.le).mpr h\u27e9\u27e9\n have hn\u2080 : (0 : \u211d) < n := hX\u2080.trans_le hXn\n have hdiv : y / n \u2264 w n := (div_le_iff\u2080 hn\u2080).2 <| calc\n y \u2264 X * w n := hw n hn\n _ \u2264 n * w n := mul_le_mul_of_nonneg_right hXn (hw\u2080 n hn)\n _ = w n * n := mul_comm ..\n rw [max_eq_right (sub_nonpos.mpr hdiv), mul_zero]\n rw [\u2190 sum_subset hS\u2081 hsupport]\n calc\n _ \u2264 \u2211 n \u2208 S, 2 * y * (\u039b n / n) := by\n refine sum_le_sum fun n hn \u21a6 ?_\n have hnN := hS\u2081 hn\n have hn\u2080 : (0 : \u211d) \u2264 n := Nat.cast_nonneg _\n calc\n _ \u2264 (2 * \u039b n) * (y / n) := by\n apply mul_le_mul (ha n hnN).2\n \u00b7 exact max_le (sub_le_self _ (hw\u2080 n hnN)) (div_nonneg hy hn\u2080)\n \u00b7 exact le_max_right ..\n \u00b7 positivity\n _ = _ := by ring\n _ \u2264 \u2211 n \u2208 Ioc 0 \u230aX\u230b\u208a, 2 * y * (\u039b n / n) :=\n sum_le_sum_of_subset_of_nonneg hS\u2082 fun _ _ _ \u21a6 by positivity\n _ = 2 * y * \u2211 n \u2208 Ioc 0 \u230aX\u230b\u208a, \u039b n / n := by rw [mul_sum]\n _ \u2264 4 * y * Real.log X := by\n calc\n _ \u2264 2 * y * (2 * Real.log X) :=\n mul_le_mul_of_nonneg_left (Chebyshev.sum_vonMangoldt_div_le_two_mul_log hX)\n (by positivity)\n _ = _ := by ring", "proof_lines": 39, "proof_length": 1512, "rev": "75c8aed5fea63047615a25a9763fd5b68a86e891", "heartbeats": 1676, "image": "lean-compression:tauceti-75c8aed5fe-a608030cfc", "split": "dev"} {"path": "TauCeti/AlgebraicGeometry/EllipticCurve/TateCurve/Homomorphism.lean", "module": "TauCeti.AlgebraicGeometry.EllipticCurve.TateCurve.Homomorphism", "theorem": "TauCeti.tateUniformization_mul", "prefix": "/-\nCopyright (c) 2026 The Tau Ceti contributors. All rights reserved.\nReleased under Apache 2.0 license as described in the file LICENSE.\nAuthors: The Tau Ceti contributors\n-/\nmodule\n\npublic import TauCeti.AlgebraicGeometry.EllipticCurve.TateCurve.Injectivity\nimport TauCeti.AlgebraicGeometry.EllipticCurve.TateCurve.Line\nimport TauCeti.AlgebraicGeometry.EllipticCurve.Affine.Point.Line\nimport TauCeti.Analysis.Normed.Field.ZPowers\nimport TauCeti.Algebra.Group.MapMulMulEqOne\n\n/-!\n# The Tate uniformisation is a group homomorphism\n\nLet `K` be a complete non-archimedean normed field and `q \u2208 K\u02e3` with `\u2016q\u2016 < 1`. This file proves\nthat the Tate uniformisation `K\u02e3 / q^\u2124 \u2192 E_q(K)` sends products of parameters to sums of points\n(`TauCeti.tateUniformization_mul`), and bundles it as an injective homomorphism out of\n`Additive (K\u02e3 / q^\u2124)`. The same holds over every complete normed extension `L` of `K`, for the\nmap `L\u02e3 / q^\u2124 \u2192 E_q(L)`.\n\nLet `P` denote the uniformisation. For classes `x, y` such that `x`, `y` and `(x y)\u207b\u00b9` are\npairwise distinct and different from `1`, there is a line `Y = \u03bc X + \u03bd` through `P x`, `P y` and\n`P (x y)\u207b\u00b9` (`TauCeti.exists_tateQuotientCoordinates_snd_eq_iff`), and the three points have\npairwise distinct first coordinates (`TauCeti.tateQuotientCoordinates_fst_eq_iff`). So the three\npoints sum to zero (`WeierstrassCurve.Affine.Point.some_add_some_add_some_eq_zero`).\n\nThe remaining triples with product `1`, including the tangent case `x = y`, follow from this\nsecant case by `TauCeti.map_mul_mul_eq_one_of_pairwise_ne`, which moves a pair into general\nposition with an auxiliary parameter. This needs infinitely many squares in `K\u02e3 / q^\u2124`\n(`TauCeti.infinite_range_sq_quotient_zpowers`). Neither a discrete value group nor any restriction\non the characteristic is needed.\n\n## Main results\n\n* `TauCeti.tateUniformization_mul`: the Tate uniformisation is additive.\n* `TauCeti.tateUniformizationHom`: the injective homomorphism `Additive (K\u02e3 / q^\u2124) \u2192+ E_q(K)`.\n* `TauCeti.tateUniformizationBaseChange_mul`, `TauCeti.tateUniformizationBaseChangeHom`: the\n same over a complete normed extension `L`.\n\n## References\n\n* J. H. Silverman, *Advanced Topics in the Arithmetic of Elliptic Curves*, V.3.\n* J. Tate, *A review of non-Archimedean elliptic functions* (1995).\n-/\n\npublic section\n\nnamespace TauCeti\n\nopen WeierstrassCurve WeierstrassCurve.Affine\n\nvariable {K : Type*} [NormedField K] [CompleteSpace K] [IsUltrametricDist K]\n\n/-- **The secant case.** If `x`, `y` and `z` are pairwise distinct, different from `1`, and\n`x y z = 1`, then `P x + P y + P z = 0`: the three points lie on the line through `P x` and\n`P y`. -/\nprivate theorem tateUniformization_add_add_eq_zero [DecidableEq K] (q : K\u02e3)\n (hq : \u2016(q : K)\u2016 < 1) {x y z : K\u02e3 \u29f8 Subgroup.zpowers q} (hx : x \u2260 1) (hy : y \u2260 1)\n (hz : z \u2260 1) (hne : x \u2260 y) (hxz : x \u2260 z) (hyz : y \u2260 z) (hxyz : x * y * z = 1) :\n tateUniformization q hq x + tateUniformization q hq y + tateUniformization q hq z = 0 := by\n obtain rfl : z = (x * y)\u207b\u00b9 := (inv_eq_of_mul_eq_one_right hxyz).symm\n have hxy : x * y \u2260 1 := fun h \u21a6 hz (by rw [h, inv_one])\n obtain \u27e8\u03bc, \u03bd, hline\u27e9 := exists_tateQuotientCoordinates_snd_eq_iff q hq hx hy hxy\n have d\u2081\u2082 : (tateQuotientCoordinates q x).1 \u2260 (tateQuotientCoordinates q y).1 := by\n rw [Ne, tateQuotientCoordinates_fst_eq_iff q hq hx hy]\n rintro (h | rfl)\n \u00b7 exact hne h\n \u00b7 exact hxy (inv_mul_cancel y)\n have d\u2083\u2081 : (tateQuotientCoordinates q (x * y)\u207b\u00b9).1 \u2260 (tateQuotientCoordinates q x).1 := by\n rw [Ne, tateQuotientCoordinates_fst_eq_iff q hq hz hx]\n rintro (h | h)\n \u00b7 exact hxz h.symm\n \u00b7 have h' : x * y = x := inv_inj.mp h\n exact hy (by rw [\u2190 inv_mul_cancel_left x y, h', inv_mul_cancel])\n have d\u2083\u2082 : (tateQuotientCoordinates q (x * y)\u207b\u00b9).1 \u2260 (tateQuotientCoordinates q y).1 := by\n rw [Ne, tateQuotientCoordinates_fst_eq_iff q hq hz hy]\n rintro (h | h)\n \u00b7 exact hyz h.symm\n \u00b7 have h' : x * y = y := inv_inj.mp h\n exact hx (by rw [\u2190 mul_inv_cancel_right x y, h', mul_inv_cancel])\n -- the images of `x`, `y` and `(x y)\u207b\u00b9` lie on the line and sum to zero\n rw [tateUniformization_of_ne_one q hq hx, tateUniformization_of_ne_one q hq hy,\n tateUniformization_of_ne_one q hq hz]\n exact Point.some_add_some_add_some_eq_zero _ _ _ d\u2081\u2082 d\u2083\u2081.symm d\u2083\u2082.symm\n ((hline x hx).mpr (.inl rfl)) ((hline y hy).mpr (.inr (.inl rfl)))\n ((hline _ hz).mpr (.inr (.inr rfl)))\n\n", "statement": "/-- **The Tate uniformisation is additive.** For a complete non-archimedean normed field `K` and\n`q \u2208 K\u02e3` with `\u2016q\u2016 < 1`, the map `K\u02e3 / q^\u2124 \u2192 E_q(K)` sends products of parameters to sums of\npoints. -/\n@[simp]\ntheorem tateUniformization_mul [DecidableEq K] (q : K\u02e3) (hq : \u2016(q : K)\u2016 < 1)\n (x y : K\u02e3 \u29f8 Subgroup.zpowers q) :\n tateUniformization q hq (x * y) = tateUniformization q hq x + tateUniformization q hq y ", "proof": " by\n -- the secant case extends to all triples with product `1`, in the multiplicative target\n have h : tateUniformization q hq x + tateUniformization q hq y +\n tateUniformization q hq (x * y)\u207b\u00b9 = 0 :=\n map_mul_mul_eq_one_of_pairwise_ne\n (f := fun w \u21a6 Multiplicative.ofAdd (tateUniformization q hq w))\n (infinite_range_sq_quotient_zpowers q hq)\n (congrArg Multiplicative.ofAdd (tateUniformization_one q hq))\n (fun w \u21a6 congrArg Multiplicative.ofAdd (tateUniformization_inv q hq w))\n (fun _ _ _ ha hb hc hab hac hbc habc \u21a6 congrArg Multiplicative.ofAdd\n (tateUniformization_add_add_eq_zero q hq ha hb hc hab hac hbc habc))\n (mul_inv_cancel (x * y))\n rw [tateUniformization_inv, \u2190 sub_eq_add_neg, sub_eq_zero] at h\n exact h.symm", "proof_lines": 13, "proof_length": 622, "rev": "75c8aed5fea63047615a25a9763fd5b68a86e891", "heartbeats": 9031, "image": "lean-compression:tauceti-75c8aed5fe-a608030cfc", "split": "dev"} {"path": "TauCeti/AlgebraicGeometry/EllipticCurve/FormalGroup/Point/Add.lean", "module": "TauCeti.AlgebraicGeometry.EllipticCurve.FormalGroup.Point.Add", "theorem": "WeierstrassCurve.add_eq_formalPoint_formalAddEval_of_X_ne", "prefix": "/-\nCopyright (c) 2026 The Tau Ceti contributors. All rights reserved.\nReleased under Apache 2.0 license as described in the file LICENSE.\nAuthors: The Tau Ceti contributors\n-/\nmodule\n\npublic import TauCeti.AlgebraicGeometry.EllipticCurve.FormalGroup.PairEval\npublic import TauCeti.AlgebraicGeometry.EllipticCurve.FormalGroup.Point.Basic\n-- Proof-only: `chord_point_add` is used inside a private helper's proof.\nimport TauCeti.AlgebraicGeometry.EllipticCurve.FormalGroup.ThirdPoint\n\n/-!\n# The parametrisation carries the group law: the chord case\n\n`FormalGroup/Point/Basic.lean` sends a parameter `t` of an adic ideal to a point of `W\u2044K`, and\n`FormalGroup/PairEval.lean` gives the group law `F(t\u2081, t\u2082)` on parameters. This file joins them in\nthe case where the chord through the two points is not vertical: the point of the parameter\n`F(t\u2081, t\u2082)` is the sum of the points of `t\u2081` and `t\u2082`.\n\nThis is one case of the additivity of `formalPoint`, not the whole of it. The doubling case\n`t\u2081 = t\u2082` and the inverse case `t\u2082 = \u03b9(t\u2081)` \u2014 the two ways the points can share an `x`-coordinate \u2014\neach need a different argument and are not treated here. A vanishing parameter is treated, by the\nunit laws. Only with the two remaining cases does `formalPoint` become a homomorphism, and only\nthen are the parameters of an adic ideal a subgroup of the points of `W\u2044K` rather than an indexed\nfamily of them.\n\n## The hypotheses\n\n`t\u2081 * w(t\u2082) \u2260 t\u2082 * w(t\u2081)` is the chord condition: over a field, where a nonzero parameter `t`\ncarries the coordinates `x = t / w(t)` and `y = -1 / w(t)`, it says the two points have distinct\n`x`-coordinates, so the line through them is not vertical. It is what excludes the doubling and\ninverse cases, which need a different argument and are not treated here.\n\nNothing further is asked of the parameters. `w` vanishes at `0`, so the chord condition already\nexcludes the zero parameter on either side; the sum is nonzero for the same reason, since\n`formalAddEval_eq` writes it as the formal inverse of the third root,\n`formalThirdRootEval_ne_zero` gives the third root's nonvanishing from the chord condition, and\n`formalInverseEval_ne_zero` carries it across; and `formalAddEval_mem` supplies the membership\n`formalPoint` needs of its argument, which is why the conclusion names that term rather than a\nhypothesis.\n\n`mul_formalWEval_eq_mul_formalWEval_iff` in `Point/Basic.lean` characterises the cross-product: it\nholds exactly when a parameter vanishes, or the two are equal, or they are exchanged by `\u03b9`. So\nfor two nonzero parameters those two exclusions already give the chord condition. A vanishing\nparameter is the unit law `F(0, t) = t` or `F(t, 0) = t`. That is the second form of the theorem\nbelow, and the one a caller can discharge without computing `w`.\n\n## Main results\n\n* `WeierstrassCurve.add_eq_formalPoint_formalAddEval_of_X_ne`: the point of `F(t\u2081, t\u2082)` is the\n sum of the points of `t\u2081` and `t\u2082`, for parameters whose points have distinct `x`-coordinates.\n* `WeierstrassCurve.add_eq_formalPoint_formalAddEval_of_ne_of_ne_formalInverseEval`: the same\n conclusion, asked of the parameters themselves \u2014 two nonzero parameters must be distinct and not\n exchanged by `\u03b9`, while a vanishing parameter is asked nothing, being a unit law.\n\n## Provenance\n\nAdapted from Michael Stoll's `EllipticCurves` project\n(`github.com/MichaelStollBayreuth/EllipticCurves` @ `66889eada51a`, Apache-2.0),\n`EllipticCurves/WeierstrassFormalGroup/Filtration.lean`, declarations `paramPoint_add` (the chord\ncase) and `formalPoint_add_of_ne` (the theorem below). The dichotomy the latter rests on is that\nsource's `eq_or_eq_negPoint_of_x_cond`, ported as an iff alongside `formalPoint` in\n`Point/Basic.lean`.\n\nThe argument here is a transposition of this repository's own `FormalGroup/Add/Assoc.lean`, whose\nprivate `thetaPoint_add` runs the same chord computation one level up \u2014 over a fraction field of\nthe power-series ring rather than at a parameter \u2014 for the associativity of `formalAdd`. The\nscalar inputs come from the `Eval` and `PairEval` layers instead of that file's substitution\nlayer, and `formalPoint` replaces its `thetaPoint`.\n-/\n\nopen Polynomial\n\npublic section\n\nnamespace WeierstrassCurve\n\nvariable {O : Type*} [CommRing O] [UniformSpace O] [IsUniformAddGroup O] [CompleteSpace O]\n [T2Space O] [IsTopologicalRing O] [IsLinearTopology O O] (W : WeierstrassCurve O)\nvariable {K : Type*} [Field K] [Algebra O K]\n\n/-! ### The points\n\n`formalPoint` needs the base-changed curve to be elliptic and the structure map to be injective.\nThe group law on points needs decidable equality on `K`, which the declarations that add points\nsupply locally by classical reasoning rather than asking it of callers. The first below adds\nnothing, so it needs neither.\n\nThe argument runs in two steps: the chord construction identifies the sum with the third point of\nthe line, and the formal inverse identifies that point's negation with the point of `F(t\u2081, t\u2082)`. -/\n\n/-- **The chord's third point, negated, is the point at the sum's parameter.** The formal inverse\n`F(t\u2081, t\u2082) = i(T(t\u2081, t\u2082))` is what turns the chord construction into the group law; this is that\nstep read off on coordinates. Both nonsingularity proofs are taken rather than built, so the\nstatement says exactly which witnesses the dependent equality is between. -/\nprivate theorem some_formalThirdRootEval_eq_some_formalAddEval {I : Ideal O} (hI : IsAdic I)\n {t\u2081 t\u2082 : O} (h\u2081 : t\u2081 \u2208 I) (h\u2082 : t\u2082 \u2208 I)\n (h\u2083 : (W.baseChange K).toAffine.Nonsingular\n (algebraMap O K (W.formalThirdRootEval t\u2081 t\u2082) /\n algebraMap O K (W.formalWEval (W.formalThirdRootEval t\u2081 t\u2082)))\n ((1 - (W.baseChange K).a\u2081 * algebraMap O K (W.formalThirdRootEval t\u2081 t\u2082) -\n (W.baseChange K).a\u2083 * algebraMap O K (W.formalWEval (W.formalThirdRootEval t\u2081 t\u2082))) /\n algebraMap O K (W.formalWEval (W.formalThirdRootEval t\u2081 t\u2082))))\n (hnF : (W.baseChange K).toAffine.Nonsingular\n (algebraMap O K (W.formalAddEval t\u2081 t\u2082) /\n algebraMap O K (W.formalWEval (W.formalAddEval t\u2081 t\u2082)))\n (-1 / algebraMap O K (W.formalWEval (W.formalAddEval t\u2081 t\u2082)))) :\n Affine.Point.some _ _ h\u2083 = Affine.Point.some _ _ hnF := by\n have hE\u2081 : PowerSeries.HasEval t\u2081 := hI.isTopologicallyNilpotent_of_mem h\u2081\n have hE\u2082 : PowerSeries.HasEval t\u2082 := hI.isTopologicallyNilpotent_of_mem h\u2082\n have hET : PowerSeries.HasEval (W.formalThirdRootEval t\u2081 t\u2082) :=\n W.hasEval_formalThirdRootEval hE\u2081 hE\u2082\n -- the addition series is the formal inverse of the third root, so the two coordinate identities\n -- of the inverse law are exactly what distinguishes the two points\n rw [Affine.Point.some.injEq, W.formalAddEval_eq hE\u2081 hE\u2082]\n exact \u27e8(W.algebraMap_formalInverseEval_div_algebraMap_formalWEval_formalInverseEval hET).symm,\n (W.neg_one_div_algebraMap_formalWEval_formalInverseEval hET).symm\u27e9\n\nvariable [FaithfulSMul O K] in\nopen scoped Classical in\n/-- The group law of `W\u2044K` at the two parametrised points, each written as an `Affine.Point.some`\nat the coordinates `x = t / w(t)` and `y = -1 / w(t)`. The three nonsingularity proofs are taken\nrather than built, so the statement says exactly which witnesses the dependent equality is\nbetween. -/\nprivate theorem some_add_some_formalAddEval_of_X_ne {I : Ideal O} (hI : IsAdic I) {t\u2081 t\u2082 : O}\n (h\u2081 : t\u2081 \u2208 I) (h\u2082 : t\u2082 \u2208 I)\n (hx : t\u2081 * W.formalWEval t\u2082 \u2260 t\u2082 * W.formalWEval t\u2081)\n (hn\u2081 : (W.baseChange K).toAffine.Nonsingular\n (algebraMap O K t\u2081 / algebraMap O K (W.formalWEval t\u2081))\n (-1 / algebraMap O K (W.formalWEval t\u2081)))\n (hn\u2082 : (W.baseChange K).toAffine.Nonsingular\n (algebraMap O K t\u2082 / algebraMap O K (W.formalWEval t\u2082))\n (-1 / algebraMap O K (W.formalWEval t\u2082)))\n (hnF : (W.baseChange K).toAffine.Nonsingular\n (algebraMap O K (W.formalAddEval t\u2081 t\u2082) /\n algebraMap O K (W.formalWEval (W.formalAddEval t\u2081 t\u2082)))\n (-1 / algebraMap O K (W.formalWEval (W.formalAddEval t\u2081 t\u2082)))) :\n Affine.Point.some _ _ hn\u2081 + Affine.Point.some _ _ hn\u2082 = Affine.Point.some _ _ hnF := by\n have hE\u2081 : PowerSeries.HasEval t\u2081 := hI.isTopologicallyNilpotent_of_mem h\u2081\n have hE\u2082 : PowerSeries.HasEval t\u2082 := hI.isTopologicallyNilpotent_of_mem h\u2082\n have hne : \u2200 {s : O}, s \u2260 0 \u2192 algebraMap O K s \u2260 0 := fun hs0 \u21a6 by simpa using hs0\n have hwT0 := W.algebraMap_formalWEval_ne_zero (S := K)\n (W.hasEval_formalThirdRootEval hE\u2081 hE\u2082)\n (hne (W.formalThirdRootEval_ne_zero hE\u2081 hE\u2082 hx))\n -- the chord data, read in `K`: each is the image under `algebraMap O K` of an identity of the\n -- `Eval` and `PairEval` layers, pushed through the ring hom into the shape `chord_point_add` and\n -- the coordinate comparison consume\n have hq\u2081 := congrArg (algebraMap O K) (W.formalWEval_wEquation hE\u2081)\n have hq\u2082 := congrArg (algebraMap O K) (W.formalWEval_wEquation hE\u2082)\n have hslope := congrArg (algebraMap O K) (W.formalSlopeEval_mul_sub hE\u2081 hE\u2082)\n have hint := congrArg (algebraMap O K) (W.formalInterceptEval_eq hE\u2081 hE\u2082)\n have hrel := congrArg (algebraMap O K) (W.formalThirdRootEval_relation hE\u2081 hE\u2082)\n have hwT := congrArg (algebraMap O K) (W.formalWEval_formalThirdRootEval hE\u2081 hE\u2082)\n rw [wEquationRHS_def] at hq\u2081 hq\u2082\n simp only [map_add, map_sub, map_neg, map_mul, map_pow, map_one,\n map_ofNat] at hq\u2081 hq\u2082 hslope hint hrel hwT\n -- the group law of `W\u2044K`, applied to the two parametrised points\n -- the chord cubic's leading coefficient is a unit in `O`, so nonzero in `K`\n have hA := ((W.isUnit_thirdRootDenom (hI.isTopologicallyNilpotent_of_mem (by\n simpa using W.formalSlopeEval_mem hI (k := 1) (by simpa using h\u2081)\n (by simpa using h\u2082)))).map (algebraMap O K)).ne_zero\n rw [map_add, map_add, map_add, map_mul, map_mul, map_mul, map_pow, map_pow, map_one] at hA\n -- the numerator of the difference of the two `x`-coordinates\n have hxK := hne (sub_ne_zero.2 hx)\n rw [map_sub, map_mul, map_mul] at hxK\n obtain \u27e8h\u2083, hadd\u27e9 := chord_point_add (W.baseChange K) hq\u2081 hq\u2082 hslope hint hrel hwT hA\n hwT0 hxK hn\u2081 hn\u2082\n exact hadd.trans (W.some_formalThirdRootEval_eq_some_formalAddEval hI h\u2081 h\u2082 h\u2083 hnF)\n\nvariable [(W.baseChange K).IsElliptic] [FaithfulSMul O K]\n\nopen scoped Classical in\n", "statement": "/-- **The parametrisation carries the group law**, for two nonzero parameters whose points have\ndistinct `x`-coordinates: the point of `F(t\u2081, t\u2082)` is the sum of the points of `t\u2081` and `t\u2082`.\n\nThe chord through the two points meets the curve again at the parameter `t\u2083(t\u2081, t\u2082)`, and the\naddition series is the formal inverse of that third root, so the group law of `W\u2044K` applied to the\ntwo points computes `F(t\u2081, t\u2082)`. -/\n@[simp]\ntheorem add_eq_formalPoint_formalAddEval_of_X_ne {I : Ideal O} (hI : IsAdic I) {t\u2081 t\u2082 : O}\n (h\u2081 : t\u2081 \u2208 I) (h\u2082 : t\u2082 \u2208 I) (hx : t\u2081 * W.formalWEval t\u2082 \u2260 t\u2082 * W.formalWEval t\u2081) :\n W.formalPoint (K := K) hI h\u2081 + W.formalPoint (K := K) hI h\u2082 =\n W.formalPoint (K := K) hI (pow_one I \u25b8 W.formalAddEval_mem hI (k := 1)\n ((pow_one I).symm \u25b8 h\u2081) ((pow_one I).symm \u25b8 h\u2082)) ", "proof": " by\n -- the chord condition already excludes the zero parameter, `w` vanishing there\n have h\u20810 : t\u2081 \u2260 0 := by rintro rfl; simp at hx\n have h\u20820 : t\u2082 \u2260 0 := by rintro rfl; simp at hx\n have hE\u2081 : PowerSeries.HasEval t\u2081 := hI.isTopologicallyNilpotent_of_mem h\u2081\n have hE\u2082 : PowerSeries.HasEval t\u2082 := hI.isTopologicallyNilpotent_of_mem h\u2082\n -- the sum is nonzero because the third root is, the formal inverse preserving nonvanishing\n have hF0 : W.formalAddEval t\u2081 t\u2082 \u2260 0 :=\n (W.formalAddEval_eq hE\u2081 hE\u2082).trans_ne <| W.formalInverseEval_ne_zero\n (W.hasEval_formalThirdRootEval hE\u2081 hE\u2082) (W.formalThirdRootEval_ne_zero hE\u2081 hE\u2082 hx)\n have hF : W.formalAddEval t\u2081 t\u2082 \u2208 I :=\n pow_one I \u25b8 W.formalAddEval_mem hI (k := 1) ((pow_one I).symm \u25b8 h\u2081) ((pow_one I).symm \u25b8 h\u2082)\n have hne : \u2200 {s : O}, s \u2260 0 \u2192 algebraMap O K s \u2260 0 := fun hs0 \u21a6 by simpa using hs0\n -- `equation_iff_nonsingular` states the `y`-coordinate as `-(w(t))\u207b\u00b9`, the chord lemmas as\n -- `-1 / w(t)`; `neg_div` and `one_div` bridge the two\n have hn : \u2200 {s : O} (hs : s \u2208 I), s \u2260 0 \u2192 (W.baseChange K).toAffine.Nonsingular\n (algebraMap O K s / algebraMap O K (W.formalWEval s))\n (-1 / algebraMap O K (W.formalWEval s)) := fun hs hs0 \u21a6 by\n simpa only [neg_div, one_div] using Affine.equation_iff_nonsingular.mp\n (W.equation_formalPoint (hI.isTopologicallyNilpotent_of_mem hs)\n (W.algebraMap_formalWEval_ne_zero (hI.isTopologicallyNilpotent_of_mem hs) (hne hs0)))\n rw [W.formalPoint_of_param_ne_zero hI h\u2081 h\u20810, W.formalPoint_of_param_ne_zero hI h\u2082 h\u20820,\n W.formalPoint_of_param_ne_zero hI _ hF0]\n -- `Affine.Point.mk` is the `some` constructor at `-(w(t))\u207b\u00b9`\n simpa only [Affine.Point.mk, neg_div, one_div] using\n W.some_add_some_formalAddEval_of_X_ne hI h\u2081 h\u2082 hx (hn h\u2081 h\u20810) (hn h\u2082 h\u20820) (hn hF hF0)", "proof_lines": 25, "proof_length": 1334, "rev": "75c8aed5fea63047615a25a9763fd5b68a86e891", "heartbeats": 1273, "image": "lean-compression:tauceti-75c8aed5fe-a608030cfc", "split": "dev"} {"path": "TauCeti/Topology/UnitInterval.lean", "module": "TauCeti.Topology.UnitInterval", "theorem": "unitInterval.arcIndex_eq_or", "prefix": "/-\nCopyright (c) 2026 Lean FRO, LLC. All rights reserved.\nReleased under Apache 2.0 license as described in the file LICENSE.\nAuthors: Kim Morrison\n-/\nmodule\n\npublic import Mathlib.Topology.UnitInterval\npublic import Mathlib.Topology.Order.ProjIcc\n\n/-!\n# Partitions and clipped subdivisions of intervals\n\n`unitInterval.Partition n` is a monotone sequence `0 = t\u2080 \u2264 \u22ef \u2264 t\u2099 = 1` in the unit interval.\nIt indexes the segments of the tube neighbourhoods of paths in\n`TauCeti.Topology.Homotopy.TubeNeighborhood`.\n\nMathlib's `Set.Icc.addNSMul` gives equally spaced subdivisions clipped at the right endpoint.\nWe give its closed form and continuity in the step size. Step sizes tending to a positive limit\nalong a filter reach the endpoint after a single number of steps, eventually along the filter;\nfor positive step sizes continuous at a parameter, this number is valid throughout a\nneighbourhood, which permits locally finite compositions without a global positive lower bound.\n\nFinally, `unitInterval.abs_coe_le_one` and `Set.abs_projIcc_le` bound the absolute value of a\npoint of the unit interval by `1`, and that of the projection onto a symmetric interval\n`[-a, a]` by `a`. These are the side conditions for scaling by a factor `b` with `|b| \u2264 1`.\nSimilarly `unitInterval.abs_two_mul_sub_one_le_one` bounds `|2t - 1|` by `1`, for the\nreparametrisation `t \u21a6 2t - 1` of the unit interval onto `[-1, 1]`.\n\nThe subdivision of the unit interval into `r` equal arcs `[i/r, (i+1)/r]` is described by\n`unitInterval.arcPoint r i a`, the point `(i + a) / r` at parameter `a` of the `i`-th arc, and\nconversely by `unitInterval.arcIndex r s` and `unitInterval.arcParam r s`, the arc containing a\npoint `s` and the position of `s` in it, the end point `1` being counted in the last arc.\n\n`unitInterval.dyadicArcParam i` continuously rescales the dyadic arc\n`[1 / 2^(i+1), 1 / 2^i]` to the unit interval using `Set.projIcc`. It stays at the corresponding\nendpoint outside the arc, so the arc of index `i + 1` finishes before that of index `i` starts.\n-/\n\n-- Ported from https://github.com/leanprover-community/mathlib4/pull/44183.\n\npublic section\n\nnamespace unitInterval\n\n/-- A partition `0 = t\u2080 \u2264 \u22ef \u2264 t\u2099 = 1` of the unit interval into `n` segments. -/\nstructure Partition (n : \u2115) where\n /-- The partition points. -/\n t : Fin (n + 1) \u2192 I\n /-- The partition points are monotone. -/\n mono : Monotone t\n /-- The first partition point is `0`. -/\n t_zero : t 0 = 0\n /-- The last partition point is `1`. -/\n t_last : t (Fin.last n) = 1\n\nnamespace Partition\n\nattribute [simp] t_zero t_last\n\n/-- There is no partition into zero segments, since `t 0` would be both `0` and `1`. -/\ninstance : IsEmpty (Partition 0) :=\n \u27e8fun p \u21a6 zero_ne_one (p.t_zero.symm.trans p.t_last)\u27e9\n\n/-- Consecutive partition points are ordered. -/\ntheorem t_castSucc_le_succ {n : \u2115} (part : Partition n) (i : Fin n) :\n part.t i.castSucc \u2264 part.t i.succ :=\n part.mono i.castSucc_le_succ\n\nend Partition\n\n/-- A point of the unit interval has absolute value at most one. -/\ntheorem abs_coe_le_one (t : I) : |(t : \u211d)| \u2264 1 :=\n (abs_of_nonneg t.property.1).trans_le t.property.2\n\n/-- For a point `t` of the unit interval, `2t - 1` lies in `[-1, 1]`. -/\ntheorem abs_two_mul_sub_one_le_one (t : I) : |2 * (t : \u211d) - 1| \u2264 1 :=\n abs_le.2 \u27e8by linarith [t.property.1], by linarith [t.property.2]\u27e9\n\n/-- The parameter of `t` on the dyadic arc `[1 / 2^(i+1), 1 / 2^i]`, rescaled to\n`[0, 1]` and clipped at its endpoints. -/\nnoncomputable def dyadicArcParam (i : \u2115) (t : I) : I :=\n Set.projIcc 0 1 zero_le_one ((2 : \u211d) ^ (i + 1) * (t : \u211d) - 1)\n\n/-- The dyadic arc parameter is the projection of the rescaled time onto `[0, 1]`. -/\ntheorem dyadicArcParam_def (i : \u2115) (t : I) :\n dyadicArcParam i t = Set.projIcc 0 1 zero_le_one ((2 : \u211d) ^ (i + 1) * (t : \u211d) - 1) :=\n (rfl)\n\n/-- The clipped parameter on each dyadic arc is continuous. -/\n@[fun_prop]\ntheorem continuous_dyadicArcParam (i : \u2115) : Continuous (dyadicArcParam i) := by\n have hc : Continuous (fun t : I \u21a6\n Set.projIcc 0 1 zero_le_one ((2 : \u211d) ^ (i + 1) * (t : \u211d) - 1)) :=\n continuous_projIcc.comp (by fun_prop)\n simpa only [\u2190 dyadicArcParam_def] using hc\n\n/-- The dyadic arc parameter is zero exactly up to the start of its arc. -/\ntheorem dyadicArcParam_eq_zero_iff {i : \u2115} {t : I} :\n dyadicArcParam i t = 0 \u2194 (t : \u211d) \u2264 ((2 : \u211d) ^ (i + 1))\u207b\u00b9 := by\n rw [dyadicArcParam_def, projIcc_eq_zero, sub_nonpos, \u2190 le_div_iff\u2080' (by positivity), one_div]\n\n/-- The dyadic arc parameter is one exactly from the end of its arc onward. -/\ntheorem dyadicArcParam_eq_one_iff {i : \u2115} {t : I} :\n dyadicArcParam i t = 1 \u2194 ((2 : \u211d) ^ i)\u207b\u00b9 \u2264 (t : \u211d) := by\n rw [dyadicArcParam_def, projIcc_eq_one, inv_le_iff_one_le_mul\u2080' (by positivity),\n pow_succ, mul_right_comm]\n constructor <;> intro h <;> linarith\n\n/-- At time `0` the parameter is at the start of every dyadic arc. -/\n@[simp]\ntheorem dyadicArcParam_zero (i : \u2115) : dyadicArcParam i 0 = 0 :=\n dyadicArcParam_eq_zero_iff.mpr (by simp only [Set.Icc.coe_zero]; positivity)\n\n/-- At time `1` the parameter is at the end of every dyadic arc. -/\n@[simp]\ntheorem dyadicArcParam_one (i : \u2115) : dyadicArcParam i 1 = 1 :=\n dyadicArcParam_eq_one_iff.mpr (by\n rw [Set.Icc.coe_one]\n exact inv_le_one_of_one_le\u2080 (one_le_pow\u2080 one_le_two))\n\n/-- Once the parameter on dyadic arc `i` is positive, arc `i + 1` has already finished. -/\ntheorem dyadicArcParam_succ_eq_one_of_pos {i : \u2115} {t : I} (h : 0 < (dyadicArcParam i t : \u211d)) :\n dyadicArcParam (i + 1) t = 1 := by\n have hn : dyadicArcParam i t \u2260 0 := fun he \u21a6 h.ne' (by rw [he, Set.Icc.coe_zero])\n exact dyadicArcParam_eq_one_iff.mpr\n (lt_of_not_ge fun hle \u21a6 hn (dyadicArcParam_eq_zero_iff.mpr hle)).le\n\nend unitInterval\n\nopen Filter Set Topology\n\nnamespace Set\n\n/-- The projection onto a symmetric interval `[-a, a]` has absolute value at most `a`. -/\ntheorem abs_projIcc_le {\u03b1 : Type*} [AddCommGroup \u03b1] [LinearOrder \u03b1] [IsOrderedAddMonoid \u03b1]\n {a : \u03b1} (h : -a \u2264 a) (x : \u03b1) : |(projIcc (-a) a h x : \u03b1)| \u2264 a :=\n abs_le.2 (projIcc (-a) a h x).property\n\nend Set\n\nnamespace Set.Icc\n\n/-- With a nonnegative step, the lower clipping in `addNSMul` is redundant. -/\n@[simp]\ntheorem coe_addNSMul {\u03b1 : Type*} [AddCommGroup \u03b1] [LinearOrder \u03b1]\n [IsOrderedAddMonoid \u03b1] {a b \u03b4 : \u03b1} (h : a \u2264 b) (h\u03b4 : 0 \u2264 \u03b4) (n : \u2115) :\n (addNSMul h \u03b4 n : \u03b1) = min b (a + n \u2022 \u03b4) := by\n rw [addNSMul, coe_projIcc, max_eq_right]\n exact le_min h (le_add_of_nonneg_right (nsmul_nonneg h\u03b4 n))\n\n/-- Each point of the clipped subdivision varies continuously with its step size. -/\n@[fun_prop]\ntheorem continuous_addNSMul {\u03b1 : Type*} [AddCommGroup \u03b1] [LinearOrder \u03b1]\n [TopologicalSpace \u03b1] [OrderTopology \u03b1] [ContinuousAdd \u03b1]\n {a b : \u03b1} (h : a \u2264 b) (n : \u2115) :\n Continuous fun \u03b4 : \u03b1 \u21a6 addNSMul h \u03b4 n := by\n unfold addNSMul\n fun_prop\n\n/-- Step sizes tending to a positive limit along a filter reach the right endpoint after a single\nnumber of steps, eventually along that filter. In particular, positive step sizes continuous at a\nparameter do so on a neighbourhood of that parameter. -/\ntheorem exists_eventually_addNSMul_eq_right {\u03b1 X : Type*} [AddCommGroup \u03b1] [LinearOrder \u03b1]\n [IsOrderedAddMonoid \u03b1] [Archimedean \u03b1] [TopologicalSpace \u03b1] [OrderTopology \u03b1]\n {a b : \u03b1} (h : a \u2264 b) {\u03b4 : X \u2192 \u03b1} {l : Filter X} {c : \u03b1}\n (h\u03b4 : Tendsto \u03b4 l (\ud835\udcdd c)) (hc : 0 < c) :\n \u2203 N : \u2115, \u2200\u1da0 y in l, \u2200 n \u2265 N, addNSMul h (\u03b4 y) n = b := by\n obtain \u27e8d, e, hcde, hde, hpos\u27e9 := exists_Icc_mem_subset_of_mem_nhds (Ioi_mem_nhds hc)\n have hd0 : 0 < d := hpos (left_mem_Icc.2 (hcde.1.trans hcde.2))\n obtain \u27e8N, hN\u27e9 := Archimedean.arch (b - a) hd0\n refine \u27e8N, ?_\u27e9\n filter_upwards [h\u03b4 hde] with y hy n hn\n rw [coe_addNSMul h (hd0.le.trans hy.1), min_eq_left]\n exact sub_le_iff_le_add'.mp\n (hN.trans ((nsmul_le_nsmul_left hd0.le hn).trans (nsmul_le_nsmul_right hy.1 n)))\n\nend Set.Icc\n\n/-! ### Equal subdivisions of the unit interval -/\n\nnamespace unitInterval\n\n/-- The point `(i + a) / r` of the unit interval: the point at parameter `a` of the `i`-th of the\n`r` equal arcs `[i/r, (i+1)/r]`. -/\nnoncomputable def arcPoint (r i : \u2115) (a : I) : I :=\n projIcc 0 1 zero_le_one ((i + a) / r)\n\ntheorem coe_arcPoint {r i : \u2115} (hi : i < r) (a : I) : (arcPoint r i a : \u211d) = (i + a) / r := by\n have hr : (0 : \u211d) < r := by exact_mod_cast (Nat.zero_le i).trans_lt hi\n have hir : (i : \u211d) + 1 \u2264 r := by exact_mod_cast hi\n rw [arcPoint, projIcc_of_mem]\n exact \u27e8by have := a.property.1; positivity, (div_le_one hr).2 (by linarith [a.property.2])\u27e9\n\n@[fun_prop]\ntheorem continuous_arcPoint (r i : \u2115) : Continuous (arcPoint r i) := by\n unfold arcPoint\n fun_prop\n\n/-- With no arcs, every arc point is `0`. -/\n@[simp]\ntheorem arcPoint_zero_left (i : \u2115) (a : I) : arcPoint 0 i a = 0 := by\n simp [arcPoint]\n\n/-- The end of an arc is the start of the next one. -/\ntheorem arcPoint_one (r i : \u2115) : arcPoint r i 1 = arcPoint r (i + 1) 0 := by\n simp [arcPoint]\n\n/-- The first arc starts at `0`. -/\n@[simp]\ntheorem arcPoint_zero_zero (r : \u2115) : arcPoint r 0 0 = 0 := by\n simp [arcPoint]\n\n/-- The start of the arc after the last of the `r` arcs is the end point `1`. -/\ntheorem arcPoint_self_zero {r : \u2115} (hr : 0 < r) : arcPoint r r 0 = 1 := by\n simp [arcPoint, hr.ne']\n\n/-- The index of the arc containing a point `s` of the unit interval, `\u230ar s\u230b`, except that the\nend point `1` belongs to the last arc. -/\nnoncomputable def arcIndex (r : \u2115) (s : I) : \u2115 :=\n min \u230a(r : \u211d) * s\u230b\u208a (r - 1)\n\n/-- The position `r s - arcIndex r s` of `s` inside its arc, rescaled to the unit interval. -/\nnoncomputable def arcParam (r : \u2115) (s : I) : I :=\n projIcc 0 1 zero_le_one ((r : \u211d) * s - arcIndex r s)\n\n/-- With no arcs, every point is counted in the arc of index `0`. -/\n@[simp]\ntheorem arcIndex_zero_left (s : I) : arcIndex 0 s = 0 := by\n simp [arcIndex]\n\ntheorem arcIndex_lt {r : \u2115} (hr : 0 < r) (s : I) : arcIndex r s < r :=\n (min_le_right _ _).trans_lt (Nat.sub_lt hr one_pos)\n\ntheorem arcIndex_le_mul (r : \u2115) (s : I) : (arcIndex r s : \u211d) \u2264 r * s :=\n (Nat.cast_le.2 (min_le_left _ _)).trans (Nat.floor_le (by have := s.property.1; positivity))\n\ntheorem mul_le_arcIndex_add_one {r : \u2115} (hr : 0 < r) (s : I) :\n (r : \u211d) * s \u2264 arcIndex r s + 1 := by\n rcases le_total \u230a(r : \u211d) * s\u230b\u208a (r - 1) with h | h\n \u00b7 rw [arcIndex, min_eq_left h]\n exact (Nat.lt_floor_add_one _).le\n \u00b7 rw [arcIndex, min_eq_right h]\n push_cast [Nat.cast_sub hr]\n simpa using mul_le_of_le_one_right (Nat.cast_nonneg r) s.property.2\n\ntheorem coe_arcParam {r : \u2115} (hr : 0 < r) (s : I) :\n (arcParam r s : \u211d) = r * s - arcIndex r s := by\n rw [arcParam, projIcc_of_mem]\n exact \u27e8sub_nonneg.2 (arcIndex_le_mul r s), by linarith [mul_le_arcIndex_add_one hr s]\u27e9\n\n/-- A point is the point of its arc at its position in the arc. -/\ntheorem arcPoint_arcIndex_arcParam {r : \u2115} (hr : 0 < r) (s : I) :\n arcPoint r (arcIndex r s) (arcParam r s) = s := by\n have hr' : (r : \u211d) \u2260 0 := by exact_mod_cast hr.ne'\n ext\n rw [coe_arcPoint (arcIndex_lt hr s), coe_arcParam hr, add_sub_cancel, mul_div_cancel_left\u2080 _ hr']\n\n", "statement": "/-- A point of the `i`-th arc lies in the `i`-th arc, or it is the common end point of the `i`-th\nand the `(i+1)`-th arcs and is counted in the latter. -/\ntheorem arcIndex_eq_or {r i : \u2115} (hi : i < r) {s : I} (h\u2080 : (i : \u211d) \u2264 r * s)\n (h\u2081 : (r : \u211d) * s \u2264 i + 1) :\n arcIndex r s = i \u2228 arcIndex r s = i + 1 \u2227 (r : \u211d) * s = i + 1 ", "proof": " by\n have hs : (0 : \u211d) \u2264 r * s := by have := s.property.1; positivity\n have hle : i \u2264 \u230a(r : \u211d) * s\u230b\u208a := Nat.le_floor h\u2080\n have hge : \u230a(r : \u211d) * s\u230b\u208a \u2264 i + 1 := Nat.floor_le_of_le (by exact_mod_cast h\u2081)\n rcases (show \u230a(r : \u211d) * s\u230b\u208a = i \u2228 \u230a(r : \u211d) * s\u230b\u208a = i + 1 by omega) with h | h\n \u00b7 left\n rw [arcIndex, h]\n omega\n \u00b7 have hrs : (r : \u211d) * s = i + 1 :=\n le_antisymm h\u2081 (by exact_mod_cast h \u25b8 Nat.floor_le hs)\n rcases Nat.lt_or_ge (i + 1) r with hi' | hi'\n \u00b7 exact Or.inr \u27e8by rw [arcIndex, h]; omega, hrs\u27e9\n \u00b7 left\n rw [arcIndex, h]\n omega", "proof_lines": 14, "proof_length": 518, "rev": "75c8aed5fea63047615a25a9763fd5b68a86e891", "heartbeats": 1702, "image": "lean-compression:tauceti-75c8aed5fe-a608030cfc", "split": "dev"}